title: PHP SOAP client not creating body
body: <p>After over a half a day of trying and reading tutorials on creating a simple SOAP client, I am no closer to retrieving a request from API I attempting to work with.</p>
  
  <p>WSDL: <a href="http://publicapi.ekmpowershop31.com/v1.1/publicapi.asmx?WSDL" rel="nofollow noreferrer">http://publicapi.ekmpowershop31.com/v1.1/publicapi.asmx?WSDL</a></p>
  
  <p>I can make the request from SOAP UI with the following simple SOAP request:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pub="http://publicapi.ekmpowershop.com/"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;pub:GetOrders&gt;
           &lt;!--Optional:--&gt;
           &lt;pub:GetOrdersRequest&gt;
                  &lt;!--Optional:--&gt;
              &lt;pub:APIKey&gt;myApiKey&lt;/pub:APIKey&gt;
           &lt;/pub:GetOrdersRequest&gt;
        &lt;/pub:GetOrders&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>This above returns the expected data. </p>
  
  <p>When it comes to translating the request into a PHP I have the following:</p>
  
  <pre><code>$wsdl = 'http://publicapi.ekmpowershop31.com/v1.1/publicapi.asmx?WSDL';
  $trace = true;
  $exceptions = false;
  $debug = true;
  
  $client = new SoapClient($wsdl,
        array(
          'trace' =&gt; $trace,
          'exceptions' =&gt; $exceptions,
          'debug' =&gt; $debug,
        ));
  
  
  $param = array('GetOrdersRequest' =&gt; array(
                 'APIKey' =&gt; 'myApiKey'
              )
            );
  
  $resp = $client-&gt;GetOrders();
  
  print_r($param);
  print_r($client-&gt;__getLastRequest());
  print_r($client-&gt;__getLastResponse());
  </code></pre>
  
  <p>If put the $param into the GetOrders function then, it breaks and nothing happens.</p>
  
  <p>Even if I use an array in the $client->GetOrders(array('someArry' => $param)) then response and request still always looks the same and looks like the body of the SOAP request is never created:</p>
  
  <p>Request:</p>
  
  <pre><code>?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://publicapi.ekmpowershop.com/"&gt;&lt;SOAP-ENV:Body&gt;&lt;ns1:GetOrders/&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;soap:Body&gt;&lt;GetOrdersResponse xmlns="http://publicapi.ekmpowershop.com/"&gt;&lt;GetOrdersResult&gt;&lt;Status&gt;Failure&lt;/Status&gt;&lt;Errors&gt;&lt;string&gt;Object reference not set to an instance of an object.&lt;/string&gt;&lt;/Errors&gt;&lt;Date&gt;2017-04-03T16:00:42.9457446+01:00&lt;/Date&gt;&lt;TotalOrders&gt;0&lt;/TotalOrders&gt;&lt;TotalCost xsi:nil="true" /&gt;&lt;/GetOrdersResult&gt;&lt;/GetOrdersResponse&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>If anyone can shed some light on what I am doing wrong here that would be real big help? </p>
  
  <p>P.S My experience of SOAP in PHP is limited as I am used to SOAP in a java env. Thanks</p>