I'm not sure if it's actually WSDL only, come to think of it, but that's what I'm using. I solved this using the fix detailed here:

http://www.php.net/manual/en/soapclient.soapcall.php#82049

Adding array() around $params in line 91 of drupal_soap_client.inc changed our output from:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="www.example.com">
<SOAP-ENV:Body>
<ns1:ExampleNS/>
<param1>bar</param1>
<param2>baz</param2>
<param3>
</param3>
<param4>aaa</param4>
<param5>bbb</param5>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

to:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="www.example.com">
<SOAP-ENV:Body>
<ns1:ExampleNS>
<ns1:Color>foo</ns1:Color>
<ns1:Flavor>bar</ns1:Flavor>
<ns1:Optional>baz</ns1:Optional>
<ns1:AlsoOptional></ns1:AlsoOptional>
<ns1:Apple>aaa</ns1:Apple>
<ns1:Banana>bbb</ns1:Banana>
</ns1:ExampleNS>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Note the missing 'foo' and the improper structure. However, this just generated an "invalid credentials" error, so for a while we thought our web service password was wrong. It wasn't until I went to see what we were actually sending that I noticed the error.

Incidentally, it would be nice if there were a debug mode checkbox in the module config. If checked, it could set $options['trace'] = 1 and call __getLastRequest() in the module code directly (so that it can be included in its error messages). It's possible to add that function in manually wherever you're calling the module from, but that makes debugging more annoying than it has to be.

Comments

greggles’s picture

It looks like this was fixed:

http://drupalcode.org/project/soapclient.git/blob/refs/heads/6.x-1.x:/li...

 $result['#return'] = $this->client->__soapCall(
 $function,
 array($params)
 );
greggles’s picture

Or is it a nusoap issue on line 61 - http://drupalcode.org/project/soapclient.git/blob/refs/heads/6.x-1.x:/li... ?

Either way, posting a patch would be a really big help compared to mentioning line numbers and describing the change.