Ebay API returns "Service operation is unknown" and "Missing SOA operation name header" errors when using PHP
<p>I'd like to make a soap call to the eBay api and finds products by keywords. With the help of <a href="http://developer.ebay.com/devzone/finding/Concepts/MakingACall.html" rel="nofollow">eBay documentation</a> and other online resources, I came up with this code:</p>

<pre><code>$client = new \SoapClient('http://developer.ebay.com/webservices/finding/latest/FindingService.wsdl');
$soap_headers = array(
    new \SoapHeader('X-EBAY-SOA-OPERATION-NAME', 'findItemsByKeywords'),
    new \SoapHeader('X-EBAY-SOA-SERVICE-VERSION', '1.3.0'),
    new \SoapHeader('X-EBAY-SOA-REQUEST-DATA-FORMAT', 'XML'),
    new \SoapHeader('X-EBAY-SOA-GLOBAL-ID', 'EBAY-US'),
    new \SoapHeader('X-EBAY-SOA-SECURITY-APPNAME', '&lt;there would be the key&gt;'),
);
$client-&gt;__setSoapHeaders($soap_headers);

// Call wsdl function
$result = $client-&gt;__soapCall("findItemsByKeywords", array("keywords" =&gt; "Potter"));
</code></pre>

<p>However, this code results in an error:
<strong>"Service operation is unknown,
500 Internal Server Error - SoapFault"</strong></p>

<p>I tried changing the first line into this (don't know why it should make a difference, but I saw it somewhere):</p>

<pre><code>$client = new \SoapClient(NULL, array(
"location" =&gt; 'http://svcs.sandbox.ebay.com/services/search/FindingService/v1', 
'uri' =&gt; 'http://svcs.sandbox.ebay.com/services/search/FindingService/v1')
);
</code></pre>

<p>And now this result in this error: <strong>Missing SOA operation name header,
500 Internal Server Error - SoapFault</strong></p>

<p>Does anybody know what causes these errors to occur and how to fix them?</p>

<p>Thank you, Mike!</p>