Skip Menu |

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

Report information
The Basics
Id: 34588
Status: resolved
Priority: 0/
Queue: SOAP-WSDL

People
Owner: Nobody in particular
Requestors: robbiebow [...] cpan.org
Cc:
AdminCc:

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



Subject: Documentation unclear
Hi The documentation is unclear as to how to pass argument to a method call. The auto-generated POD in the interface class suggests a hash ref is expected, e.g. $interface->InitiateTransaction( { .... } ); But SOAP::WSDL::Client::Base appears to be expected an array ref: $body = ref $body eq 'ARRAY' ? $body : [ $body ]; Either the documentation and auto-generated POD need updating or SOAP::WSDL::Client::Base should be refactored to cope with hashrefs.
Hmm. I've tested this further and if the request has a relatively simple data structure then passing a hashref works. However, if the request requires nested data then an arrayref is needed. For example: $service->GetWeather({ Country => 'USA' }); # works $service->GetWeather({ request => { Country => 'USA' } }); # fails $service->GetWeather([ request => { Country => 'USA' } ]); # works Probably useful to note this in the documentation.
Subject: Re: [rt.cpan.org #34588] Documentation unclear
Date: Tue, 01 Apr 2008 22:03:53 +0200
To: bug-SOAP-WSDL [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Hi Robbie, welcome to the other side of SOAP ;-) You stumbled across one of the weaker points in SOAP::WSDL - actually, the handling of list refs is left undocumented (more or less) on purpose: The WS-I spec requires, that document/literal web-services have exactly one part (which must be a element definition), as well as rpc/literal web-services (which must have a complex or simpleType as only part). In our not-so perfect world, there's web services with more than one part - thus SOAP::WSDL::Client::Base converts everything to a list ref, just to be sure. However, the last example actually should not work, because SOAP::WSDL::Client::Base should regard the content of the array ref as two parts: 'request' and { Country => 'USA' } I'll have a look at it, Martin Am Dienstag, den 01.04.2008, 03:33 -0400 schrieb Robbie Bow via RT: Show quoted text
> Queue: SOAP-WSDL > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=34588 > > > Hmm. I've tested this further and if the request has a relatively simple > data structure then passing a hashref works. However, if the request > requires nested data then an arrayref is needed. For example: > > $service->GetWeather({ Country => 'USA' }); # works > > $service->GetWeather({ request => > { Country => 'USA' } > }); # fails > > $service->GetWeather([ request => > { Country => 'USA' } > ]); # works > > Probably useful to note this in the documentation. >
Hi Robbie, as of 2.00.05, the last example does not work - however, this works: my $result = $weather->GetWeather([{ CountryName => 'Germany', CityName => 'Munich' }]); This is, however, not the intended calling synopsis for web services with only one part, and is not documented on purpose. In fact, web services with more than one part are only improperly supported, but this may change in the future (and of course the generated documentation should say $interface->method([ $part1, $part2 ]), then. Thanks for reporting, Martin