Subject: | Pod::WSDL: wrong return type |
- 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... :-)