I'm accessing the Magento SOAP API v2 with PHP's SoapClient
$soap_client = new SoapClient($wsdl_url, array('trace' => 1));
The wsdl url is http://www.example.org/index.php/api/v2_soap/?wsdl=1
Opening the url in the browser results in a valid xml document.
However when I access that same url with the SoapClient I get the following error message from $soap_client->__getLastResponse():
Invalid webservice adapter specified.
Looking at the request headers with $soap_client->__getLastRequestHeaders() shows that the call is being redirected to http://www.example.org/api/v2_soap/index/:
POST /api/v2_soap/index/ HTTP/1.1
Host: www.example.org
Connection: Keep-Alive
User-Agent: PHP-SOAP/5.4.3
Content-Type: text/xml; charset=utf-8
SOAPAction: "urn:Mage_Api_Model_Server_V2_HandlerAction"
Content-Length: 542
Calling that url (http://www.example.org/api/v2_soap/index/) in the browser outputs the same error message that the SoapClient returns (Invalid webservice adapter specified.)
How is it possible that the SoapClient is being redirected while a normal http request works fine?
Any help greatly appreciated