title: How to use nuSOAP for messages with multiple namespaces
body: <p>I'm trying to access a WebService using nuSOAP (because I'm bound to PHP4 here) that uses more than 1 namespace in a message. Is that possible?</p>
  
  <p>An example request message would look like this:</p>
  
  <pre><code>&lt;soapenv:Envelope ...
    xmlns:ns1="http://domain.tld/namespace1"
    xmlns:ns2="http://domain.tld/namespace2"&gt;
    &lt;soapenv:Header/&gt;
    &lt;soapenv:Body&gt;
      &lt;ns1:myOperation&gt;
        &lt;ns2:Person&gt;
          &lt;ns2:Firstname&gt;..&lt;/ns2:Firstname&gt;
          ..
        &lt;/ns2:Person&gt;
        &lt;ns1:Attribute&gt;..&lt;/ns1:Attribute&gt;
      &lt;/ns1:myOperation&gt;
    &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>I tried to following:</p>
  
  <pre><code>$client = new nusoap_client("my.wsdl", true);
  $params = array(
    'Person' =&gt; array(
      'FirstName'  =&gt; 'Thomas',
      ..
     ),
     'Attribute' =&gt; 'foo'
   );
  
   $result = $client-&gt;call('myOperation', $params, '', 'soapAction');
  </code></pre>
  
  <p>in the hope that nuSOAP would try to match these names to the correct namespaces and nodes. Then I tried to use soapval() to generate the elements and their namespace - but if I call an operation, nuSOAP creates the following request:</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope ...&gt;
    &lt;SOAP-ENV:Body&gt;
      &lt;queryCCApplicationDataRequest xmlns="http://domain.tld/namespace1"/&gt;
    &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>So something goes wrong during the "matching" phase.</p>