title: Why does the order of SOAP parameters matter in PHP SOAP, and how to fix it?
body: <p><a href="http://www.php.net/manual/en/soapclient.soapcall.php#98348" rel="nofollow">A comment</a> on the PHP manual states:</p>
  
  <blockquote>
    <p>If you are using this method, remember
    that the array of arguments need to be
    passed in with the ordering being the
    same order that the SOAP endpoint
    expects.</p>
    
    <p>e.g
        //server expects: Foo(string name, int age)</p>
  
  <pre><code>//won't work
  $args = array(32, 'john');
  $out = $client-&gt;__soapCall('Foo', $args);
  
  //will work
  $args = array('john', 32);
  $out = $client-&gt;__soapCall('Foo', $args);
  </code></pre>
  </blockquote>
  
  <p>I'm building a SOAP client that dynamically assigns the argument values, which means that it happens that the arguments aren't always in the correct order. This then breaks the actual SOAP call.</p>
  
  <p>Is there an easy solution to this, short of checking the order of the parameters for each call?</p>