DISCO
view release on metacpan or search on metacpan
package DISCO;
# Copyright 2004 Christian Wenz -- http://www.hauser-wenz.de/
use strict;
our $VERSION = "0.01";
our $URI;
our $DATA = undef;
use XML::Simple;
use LWP::UserAgent;
sub new {
my $self = shift;
my $class = ref($self) || $self;
my %params = @_;
$self = { URI => $params{URI} || undef };
bless ($self, $class);
return $self;
}
sub _get_data
{
my $uri = shift;
my $req = HTTP::Request->new(GET => $uri);
my $ua = LWP::UserAgent->new;
$ua->agent("DISCO.pm/$VERSION " . $ua->agent);
my $res = $ua->request($req);
if ($res->is_success) {
return $res->content;
} else {
print $res->status_line;
}
}
sub get_ref
{
my $self = shift;
$self->{DATA} = XMLin(_get_data($self->{URI})) unless defined;
return $self->{DATA}->{contractRef}->{ref};
}
sub get_docRef
{
my $self = shift;
$self->{DATA} = XMLin(_get_data($self->{URI})) unless defined;
return $self->{DATA}->{contractRef}->{docRef};
}
sub get_address
{
my $self = shift;
$self->{DATA} = XMLin(_get_data($self->{URI})) unless defined;
return $self->{DATA}->{soap}->{address};
}
# ----------------------------------
1;
__END__
=head1 NAME
DISCO - DISCO client interface
=head1 SYNOPSIS
use DISCO;
my $disco = DISCO->new(URI => 'http://');
print 'ref: ' . $disco->get_ref . "\n";
print 'docRef: ' . $disco->get_docRef . "\n";
print 'address: ' . $disco->get_address;
=head1 DESCRIPTION
This module provide functions to interpret DISCO.
DISCO (short for Discovery) is a pseudo-standard by Microsoft.
A published .disco file, which is an XML document that contains
links to other resources that describe the XML Web service,
enables programmatic discovery of an XML Web service.
More information at I<msdn.microsoft.com/library/en-us/cpguide/html/cpconwebservicediscovery.asp>.
( run in 0.482 second using v1.01-cache-2.11-cpan-39bf76dae61 )