title: How to send complex types from PHP SoapClient to ASP.NET SOAP server?
body: <p>Hello I'm having problems sending arrays, structs and arrays of structs from PHP to an ASP.NET SOAP server...</p>
  
  <p>Anyone have a sollution for this? I've googled for days and any sollution worked for me. Perphaps I'm forgetting something...</p>
  
  <p>There are examples of my code:</p>
  
  <pre><code>$client = new SoapClient($options);
  
  $pCriteria = new stdClass();
  $pCriteria-&gt;type=1;
  $pCriteria-&gt;capacity=4;
  
  //Test 1 (fail):
  $resp = $client-&gt;GetRooms(array("pCriteria"=&gt;$pCriteria));
  
  //Test 2 (fail):
  $resp = $client-&gt;GetRooms(array("pCriteria"=&gt;new SoapVar($pCriteria, SOAP_ENC_OBJECT, "TCriteria", "http://www.w3.org/2001/XMLSchema")));
  
  print_r($resp);
  </code></pre>
  
  <p>I don't know how to code functions that require an array of TCriteria (TCriteria[], TCriteria_Array type) either... i've tried sending the raw array, a SoapVar with SOAP_ENC_ARRAY encoding and TCriteria_Array type, ... but it does not work (the SOAP server becomes unavaiable and needs to be restarted).</p>
  
  <p>I've tried creating classes for the complex types too, instead of stdClass, but not working.</p>
  
  <p>I don't know where's the problem. The server admins cannot help me and I haven't found any sollution over internet. I'm a bit desperate hehe.</p>
  
  <p>Can you help me please? Can you provide samples of code with the three cases (array of simple data, array of struct and struct) ? Thanks!</p>