Thread

Posted on Mon May 7 07:42:19 2007 by nigol
import schema within the wsdl
Hi,

I wanted to use the SOAP::WSDL module, but when processing the WSDL is fails as common parts of the schema definition are defined within an import tag:

<xs:import namespace="http://servicecenter.peregrine.com/PWS/Common" schemaLocation="http://myServer:12670/PWS/Common.xsd"></xs:import>

As the WSDL is coming from Peregrine's Service Centre tool, I can not change it. Is there a way to tell SOAP::WSDL to import the remaining information?

Thanks,
Nigol
Direct Responses: 5375 | Write a response
Posted on Fri Jun 8 20:44:19 2007 by mkutter in response to 5064
Re: import schema within the wsdl
Hi Nigol,

unfortunately, there's no known way to do this, yet. SOAP::WSDL uses XML::XPath for parsing the WSDL, and XML::XPath unfortunately cannot resolve the import-Element.

I would suggest to download the WSDL, store it on disk, and insert the schema found at the specified URL into it. Unless the WSDL changes on every call (which is a bit unlikely), there's no reason why you should not be able to change it - storing it on disk instead of using a http(s) URL is even recommended for performance reasons.

Regards,

Martin

Direct Responses: 5400 | 7941 | Write a response
Posted on Tue Jun 12 03:14:24 2007 by nigol in response to 5375
Re: import schema within the wsdl

OK,Thanks for the answer.

Nigol

Write a response
Posted on Mon May 26 23:09:00 2008 by babzog in response to 5375
Re: import schema within the wsdl
Something old, is new again. :) My script, based on a lightly modified weather_wsdl.pl:
use lib 'lib/'; use lib '../lib'; # SOAP::WSDL variant use SOAP::WSDL; my $soap = SOAP::WSDL->new(); my $som = $soap->wsdl("http://192.168.2.39/NetManagerServicesBinding.wsdl") ->call('getSoftwareVersion',NULL ); die "Error" if $som->fault(); print $som->result();
results in:
cannot import document for namespace >http://schemas.xmlsoap.org/soap/encoding/< without location a +t /usr/lib/perl5/site_perl/5.8.8/SOAP/WSDL/Expat/WSDLParser.pm line 71. Can't locate object method "set_arrayType" via package "SOAP::WSDL::XSD::Attribute" at /usr/lib/per +l5/site_perl/5.8.8/SOAP/WSDL/Base.pm line 123 at line 239 at /usr/lib/perl5/site_perl/5.8.8/SOAP/WSDL/Expat/Base.pm line 76
and that seems to be because of the following:
<schema targetNamespace="http://NM2WebServices/NM2Soap" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:NetManager="http://NM2WebServices/NM2Soap" xmlns:NetManager2="http://NetManager/NetManager2" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <simpleType name=...
This WSDL file is generated by gSoap (http://www.cs.fsu.edu/~engelen/soap.html) and it imports fine into soapUI so I'm assuming it's fine. If I go to http://schemas.xmlsoap.org/soap/encoding/, cut&paste the whole thing in place of the <import ... /> blocks, I then get:
unbound prefix at line 61, column 4, byte 4064 at /usr/lib/perl5/site_perl/5.8.8/SOAP/WSDL/Expat/Ba +se.pm line 73 at line 61 at /usr/lib/perl5/site_perl/5.8.8/SOAP/WSDL/Expat/Base.pm line 76
Any thoughts?
Write a response