3

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

2
  • 1
    Have you tried disabling MultiViews in Apache with .htaccess? stackoverflow.com/questions/13932908/… Commented Aug 22, 2013 at 6:27
  • @B00MER Yep, that actually helped. Could you explain why? Commented Aug 22, 2013 at 16:37

1 Answer 1

2
+50

The effect of MultiViews is as follows: if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.