|
Hi Olivier,
this is a rather weird error. It's actually an error in the server, which has been compensated by an error in the 1.2x client.
The 1.27 client actually sends over the data in rpc/encoded form (try adding "use SOAP::Lite +trace;" at top - you'll have to remove the "use strict" for this to work). You'll see the data passed as something like
<query soapenc:arrayType="xsd:string[1]" xsi:type="xsd:string">
<item xsi:type="xsd:string">metA</item>
</query>
This is actually wrong, as the interface is document/literal, and query is defined to be a string with multiple occurances allowed, not a SOAP array type. However, SOAP::Lite (which is used behind the scenes in the 1.2x SOAP::WSDL) uses rpc/encoded with arraytype encodings as a default because your script passes a list ref as parameter.
If you add the line
$soap->autotype(0);
to the "old" client just below the wsdlinit() call, you'll see something like this:
<request>
<organism>Escherichia_coli_K12</organism>
<query>metA</query>
<from>0</from>
<to>2</to>
</request>
SOAP::WSDL 2.00.01 issues the same request. This request snippet is correct - query is defined as a string type with one or multiple occurances, so a single query string is perfectly OK.
However, the server does not seem to recognize a single string as a list, and thus treats it as empty query. If the server is in perl and under your command, something like below could help at an appropriate place:
$query = [ $query ] if not ref $query eq 'ARRAY';
As a workaround, you can also just add a undef element to the query list, so that it always has at least two elements. This adds a -q '' to the reported server query - I don't know whether it does any harm.
I hope this helps,
Martin
|