import SOAP-WSDL 2.00_32 from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  2.00_32
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL-2.00_32.tar.gz
This commit is contained in:
Martin Kutter
2009-12-12 19:48:24 -08:00
committed by Michael G. Schwern
parent f0b3bdc201
commit 51db446428
36 changed files with 376 additions and 106 deletions
+26 -2
View File
@@ -6,7 +6,7 @@ use XML::Parser::Expat;
# TODO: convert to Class::Std::Fast based class - hash based classes suck.
our $VERSION = '2.00_27';
our $VERSION = '2.00_32';
sub new {
my ($class, $arg_ref) = @_;
@@ -15,20 +15,45 @@ sub new {
$self->set_user_agent($arg_ref->{ user_agent })
if $arg_ref->{ user_agent };
$self->{ parsed } = $arg_ref->{ parsed } if $arg_ref->{ parsed };
return $self;
}
sub clone {
my $self = shift;
my $class = ref $self;
my $clone = $class->new($self);
return $clone;
}
sub set_uri { $_[0]->{ uri } = $_[1]; }
sub get_uri { return $_[0]->{ uri }; }
sub set_user_agent { $_[0]->{ user_agent } = $_[1]; }
sub get_user_agent { return $_[0]->{ user_agent }; }
sub set_parsed {
my ($self, $uri) = @_;
$self->{ parsed }->{ $uri } = 1;
return;
}
sub is_parsed {
my ($self, $uri) = @_;
return exists $self->{ parsed }->{ $uri };
}
sub parse_uri {
my $self = shift;
my $uri = shift;
if ($self->is_parsed($uri)){
warn "$uri already imported. Ignoring it\n";
return;
}
$self->set_parsed($uri);
$self->set_uri( $uri );
if (not $self->{ user_agent }) {
@@ -37,7 +62,6 @@ sub parse_uri {
}
my $response = $self->{ user_agent }->get($uri);
die $response->message() if $response->code() ne '200';
return $self->parse( $response->content() );
}