Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 40183
Status: rejected
Priority: 0/
Queue: SOAP-Lite

Owner: Nobody in particular
Requestors: timwood0 [...]

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

Subject: Unable to get SOAP::Lite to serialize a 1-D array of strings
Date: Sun, 19 Oct 2008 20:07:49 -0700
To: bug-SOAP-Lite [...]
From: Tim Wood <timwood0 [...]>
Download (untitled) / with headers
text/plain 2.5k
I am unable to get SOAP::Lite 0.710.0x to serialize a 1-D array of strings. V 0.60 did it, but would only tag both name & type with the namespace, or both not, which was incompatible with my application server. Test case in brief: --- my ($proto, %ctorArgs) = @_; # Object reference & ctor args ... my $proxy = SOAP::Lite->service($ctorArgs{'serviceURL'})->xmlschema(2001) ->uri($ctorArgs{'endpointURI'}); ... # Take an argument list and wrap it in a SOAP::Data. sub soapifyList { return SOAP::Data->new()->value(@_); } # Call remote myMethod1 with plain string arg1 and SOAP::Data-wrapped array. my $soapedArg2Array = soapifyList(9, 1); # Also NB, SOAP::Lite 0.710.0x does not let you pass a SOAP::Data holder containing $arg1, # unlike 0.60. It returns "String value expected instead of SOAP::Data reference". my $result = $proxy->myMethod1($arg1, $soapedArg2Array); ... --- The XML generated for the call goes like this (my comment and folding added): <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:tns="urn:Foo1" xmlns:ns2="" xmlns:soap="" soap:encodingStyle="" xmlns:soapenc="" xmlns:xsi="" xmlns:xsd=""> <soap:Body><tns:myMethod1> <String_1 xsi:type="xsd:string">+22522522552</String_1> <!-- ALWAYS A NIL ARRAY --><arrayOfString_2 xsi:nil="true" xsi:type="tns:ArrayOfstring" /> </tns:myMethod1></soap:Body> </soap:Envelope> The server side accepts this call and returns a correct result given the parameters, and the client side continues. So the old 0.60 problem with ns tags is fixed. But now I am unable to get the client to supply the array data in 0.710.0x. The same XML and bug occur if I do: my $soapedArg2Array = [ 9, 1 ]; and my $soapedArg2Array = soapifyList(soapifyList(9), soapifyList(1)); and my $soapedArg2Array = [ soapifyList(9), soapifyList(1) ]; Line 1535 of reads: # This is breaking a unit test right now... # proposed resolution for [ 1700326 ] encode_data called incorrectly in envelope # $body->set_value(SOAP::Utils::encode_data($parameters ? \$parameters : ())) # if $body; # must call encode_data on nothing to enforce xsi:nil="true" to be set. This suggests the code thinks the supplied SOAP::Data value for the array holds a nil (undef) but I've established that's not the case.
Download (untitled) / with headers
text/plain 229b
Hi, this issue is more of a usage question than a bug - looks like you missed an API change. Just doing SOAP::Data->new()->value( [ @_ ] ); encodes the data as requested. Closing as part of a general issue cleanup. Martin

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

Please report any issues with to