Thread

Posted on Mon Mar 31 18:40:20 2008 by lom
wsdl2perl error
Hello,
I have the following error:
/usr/share/perl5/SOAP/WSDL/Generator/Template/XSD\element.tt NOT_FOUND error - no type found for ge +tListNames at /usr/share/perl5/SOAP/WSDL/Base.pm line 53

while executing
wsdl2perl.pl 'http://glue.badc.rl.ac.uk/axis2/services/DiscoveryService?wsdl'
with the last version (2.00_33, on debian testing)
I have no error if I add type="tns:getListType" on the definition of 'getListNames' on line 8, but I doubt it is a good solution: This is not my wsdl, and I am very new to this.
Cheers,
Direct Responses: 7545 | Write a response
Posted on Mon Mar 31 21:03:10 2008 by mkutter in response to 7540
Re: wsdl2perl error
Hi lom,

As far as I know, the XML Schema specification demands element declarations to resolve to a valid type , so this looks like an error in the WSDL (I might be wrong here, please correct me). Adding any type (like type="xsd:string") should help - I guess the element is always empty.

This is probably OK if you only generate once - a permanent solution (like either fixing the WSDL, or SOAP::WSDL [provided I'm wrong above]) should be sought for.

Martin
Direct Responses: 7570 | Write a response
Posted on Wed Apr 2 17:30:38 2008 by lom in response to 7545
Re: wsdl2perl error
Hi Martin,
Thanks for your answer. As I will generate only once, I'll correct a local copy of the WSDL...

However, I found a bug (I think). The following code does nothing interesting, but shows the bug:

use lib '/home/lom/nerc/perl/lib'; use MyInterfaces::DiscoveryService::Discovery; use MyTypes::getListNamesReturnType; use MyTypes::getListReturnType; my $service = MyInterfaces::DiscoveryService::Discovery->new(); my $result = $service->doSearch('plop'); die;

gives the following error:

Bareword "true" not allowed while "strict subs" in use at /home/lom/nerc/perl/lib/MyElements/getLis +tNames.pm line 11. Compilation failed in require at /usr/share/perl5/SOAP/WSDL/Expat/MessageParser.pm line 55. ...propagated at ./tst.pl line 17.

The 'true' in getListNames.pm is due to the line 8 on the wsdl: <xs:element name="getListNames" nillable="true" type="xs:string"/>
If in the generated code (lib/MyElements/getListNames.pm) I replace
__PACKAGE__->__set_nillable(true)
by
__PACKAGE__->__set_nillable('true');
it is OK. I can as an alternative set nillable to '1' instead of 'true'...

Lom
Direct Responses: 7578 | Write a response
Posted on Thu Apr 3 09:28:52 2008 by mkutter in response to 7570
Re: wsdl2perl error
Hi Lom,

yes, that's a bug. SOAP::WSDL normally converts booleans to perl's representation of true and false (that is, 1 and 0) - looks like I missed applying the conversion here.

The alternative you mentioned is what SOAP::WSDL should have done itself.

Thanks for reporting,
Martin
Write a response