Search code examples
magentomagento-soap-api

Magento WSI SOAP v2 API Custom Webservice Returns Empty Response


Problem: I succesfully call my webservice, but I get an empty response in return.

Situation:

  • I created a new Module structure and files following this tutorial: Magento: Extending the API (v2)
    • MyNamespace
      • MyModule
        • Helper
          • Data.php
        • Model
          • MyModel
            • Api
              • V2.php
          • etc
            • api.xml
            • config.xml
            • wsdl.xml
            • wsi.xml
Also added the module config in: app/etc/modules/MyNamespace_MyModule.xml

  • I debug the call with XDebug, and effectively stops at the breakpoint inside the webservice function
  • The webservice is supposed to return a simple string: "Hello World"
  • Testing with SoapUI all I get is an empty response with content length 0.

What can be wrong or missing!? Any help is appreciated.

EDIT:

I've managed to debug the call and realized that when it reaches class Zend_Soap_Server on line 832:

$soap->handle($request);

It doesn't execute any further! I don't know why.


Solution

  • The wsdl.xml had a small mis-configuration in the following line:

    <binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    

    It should be:

    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>