title: Sending XML input to WSDL using SoapClient
body: <p>I have this WSDL: <a href="https://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx?WSDL" rel="noreferrer">https://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx?WSDL</a></p>
  
  <p>I am trying to use SoapClient to send a request to the <a href="https://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx?op=CustomerSearch" rel="noreferrer">CustomerSearch</a> method.</p>
  
  <p>The code I'm using is as follows:</p>
  
  <pre><code>$url = 'https://secure.softwarekey.com/solo/webservices/XmlCustomerService.asmx?WSDL';
  $client = new SoapClient($url);
  
  $CustomerSearch = array(
      'AuthorID' =&gt; $authorID,
      'UserID' =&gt; $userID,
      'UserPassword' =&gt; $userPassword,
      'Email' =&gt; $customerEmail 
  );
  
  $xml = array('CustomerSearch' =&gt; $CustomerSearch);
  
  $result = $client-&gt;CustomerSearch(array('xml' =&gt; $xml));
  </code></pre>
  
  <p>When I run the code, I get the following PHP exception:</p>
  
  <pre><code>Fatal error: Uncaught SoapFault exception: [Client] SOAP-ERROR: Encoding: object has no 'any' property
  </code></pre>
  
  <p>I have also tried this for the XML:</p>
  
  <pre><code>$xml = "
  &lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt; 
  &lt;CustomerSearch&gt;
      &lt;AuthorID&gt;$authorID&lt;/AuthorID&gt;
      &lt;UserID&gt;$userID&lt;/UserID&gt;
      &lt;UserPassword&gt;$userPassword&lt;/UserPassword&gt;
      &lt;Email&gt;$customerEmail&lt;/Email&gt;
  &lt;/CustomerSearch&gt;
  ";
  </code></pre>
  
  <p>Which gives me the following results (from a print_r):</p>
  
  <pre><code>object(stdClass)#4 (1) { ["CustomerSearchResult"]=&gt; object(stdClass)#5 (1) { ["any"]=&gt; string(108) "-2Invalid Xml Document" } }
  </code></pre>
  
  <p>The <a href="http://secure.softwarekey.com/solo/authors/manual/#StartTopic=Content/Choosing_the_SOLO_Server_Role.htm" rel="noreferrer">documentation</a> says that the input XML should look something like this:</p>
  
  <pre><code>&lt;CustomerSearch&gt;
  &lt;AuthorID&gt;&lt;/AuthorID&gt;
  &lt;UserID&gt;&lt;/UserID&gt;
  &lt;UserPassword&gt;&lt;/UserPassword&gt;
  &lt;SearchField&gt;&lt;/SearchField&gt;
  &lt;SearchField&gt;&lt;/SearchField&gt;
  &lt;!-- ...additional SearchField elements --&gt;
  &lt;/CustomerSearch&gt; 
  </code></pre>
  
  <p>I'm fairly new to Soap and I've tried messing around (passing in raw, typed out XML), and can't seem to get this to work.  Any insight on what I may be doing wrong would be greatly appreciated.</p>