title: How to invoke a C# web service through PHP?
body: <p>I've written a web service using ASP.NET (in C#) and I'm attempting to write an example PHP client using NuSOAP.  Where I'm tripped up on are examples of how to do this; some show <code>soapval</code> being used (and I don't quite understand the parameters - for example passing <code>false</code> as <code>string</code> types, etc.), while others are just using straight <code>array</code>s.  Let's say the WSDL for my web service as reported by <code>http://localhost:3333/Service.asmx?wsdl</code> looks something like:</p>
  
  <pre><code>POST /Service.asmx HTTP/1.1
  Host: localhost
  Content-Type: text/xml; charset=utf-8
  Content-Length: length
  SOAPAction: "http://tempuri.org/webservices/DoSomething"
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;DoSomething xmlns="http://tempuri.org/webservices"&gt;
        &lt;anId&gt;int&lt;/anId&gt;
        &lt;action&gt;string&lt;/action&gt;
        &lt;parameters&gt;
          &lt;Param&gt;
            &lt;Value&gt;string&lt;/Value&gt;
            &lt;Name&gt;string&lt;/Name&gt;
          &lt;/Param&gt;
          &lt;Param&gt;
            &lt;Value&gt;string&lt;/Value&gt;
            &lt;Name&gt;string&lt;/Name&gt;
          &lt;/Param&gt;
        &lt;/parameters&gt;
      &lt;/DoSomething&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>My first PHP attempt looks like:</p>
  
  <pre><code>&lt;?php
  require_once('lib/nusoap.php');
  $client = new nusoap_client('http://localhost:3333/Service.asmx?wsdl');
  
  $params = array(
      'anId' =&gt; 3, //new soapval('anId', 'int', 3),
      'action' =&gt; 'OMNOMNOMNOM',
      'parameters' =&gt; array(
          'firstName' =&gt; 'Scott',
          'lastName' =&gt; 'Smith'
      )
  );
  $result = $client-&gt;call('DoSomething', $params, 'http://tempuri.org/webservices/DoSomething', 'http://tempuri.org/webservices/DoSomething');
  print_r($result);
  ?&gt;
  </code></pre>
  
  <p>Now aside from the Param type being a complex type which I'm pretty sure my simple <code>$array</code> attempt will not automagically work with, I'm breakpointing in my web service and seeing the method I've marked as <code>WebMethod</code> (without renaming it, its literally <code>DoSomething</code>) and seeing the arguments are all default values (the <code>int</code> is <code>0</code>, the <code>string</code> is <code>null</code>, etc.).</p>
  
  <p>What should my PHP syntax look like, and what do I have to do to pass the <code>Param</code> type correctly?</p>