Skip Menu |
 

This queue is for tickets about the Pod-WSDL CPAN distribution.

Report information
The Basics
Id: 75902
Status: rejected
Priority: 0/
Queue: Pod-WSDL

People
Owner: Nobody in particular
Requestors: marcosolari [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.061
Fixed in: (no value)



Subject: Pod::WSDL: wrong return type
Download (untitled) / with headers
text/plain 1.4k
- The system I'm running is: Linux LinRS 3.0.0-15-generic-pae #26-Ubuntu SMP Fri Jan 20 17:07:31 UTC 2012 i686 i686 i386 GNU/Linux. - Perl I'm using is v5.12.4. - The problem is this: Implementing a method like this: =pod =begin WSDL _DOC Method hopefully returning a string _IN parameter1 $string The first STRING parameter _RETURN $string Returns a string =end WSDL =cut sub go { my ($this, $parameter1) = @_; return($parameter1); } And calling this method with a string (say: go("abc"); ), everything is fine. Calling it with a value which is a number (say: go("123"); ), produces a return type of "xsd:int", instead of "xsd:string", as I would expect from "_RETURN $string"... This is the full SOAP Envelope built: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><goResponse xmlns="http://192.168.10.21/TestService"><s-gensym3 xsi:type="xsd:int">1</s-gensym3></goResponse></soap:Body></soap:Envelope> Forcing the method "go()" to return: return("" . $parameter1); doesn't help. Forcing it to return something like this: return(" " . $parameter1); does help, but it's not what I want to return... :-)
Download (untitled) / with headers
text/plain 405b
Pod::WSDL just creates the WSDL document/output. It does not support invoking methods and ensuring that the output is consistent with the pod definition. That is the responsibility of the actual method. In this case, using SOAP::Lite to help out, the example given could be written as: sub go { my ($this, $parameter1) = @_; return SOAP::Data->value( $parameter1 )->type( 'xsd:string' ); }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.