gcw has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am new to using the Soap::WSDL module. How would I go about getting rid of this parsing error?

#!/usr/bin/perl use strict; use SOAP::WSDL +trace => 'all'; use Data::Dumper; my $ops = 'http://ops.epo.org/wsdl/ops.wsdl'; eval { my $soap=SOAP::WSDL->new( wsdl => $ops, ); }; if ($@) { print "error: $@\n"; }

Output: error: cannot import document from namespace >http://ops.epo.org< without base uri. Use >parse_uri< or >set_uri< to set one. at /usr/perl5/site_perl/5.8.4/SOAP/WSDL/Expat/WSDLParser.pm line 96. at line 10 at /usr/perl5/site_perl/5.8.4/SOAP/WSDL/Expat/Base.pm line 82

thanks a bunch!!

Replies are listed 'Best First'.
Re: soap::wsdl question
by PeterPeiGuo (Hermit) on Apr 13, 2010 at 01:03 UTC

    Inside SOAP\WSDL.pm, find this line:

    my $parser = SOAP::WSDL::Expat::WSDLParser->new();

    Right after that line, add this:

    $parser->parse_uri($wsdl_of{ $ident });

    The package seems to be buggy, you may encounter other issues...

    Peter (Guo) Pei

      SOAP::WSDL->new isn't part of the API anymore ....

        Thanks guys for the replies! I think I might try to avoid this module then. Besides Soap::Lite(has limited functionality for loading wsdl docs) and Soap::WSDL, are there any other perl modules that can successfully load wsdl documents? I tried searching cpan.org and none really stood out.. thanks!!