0

I want to save magento customer(or other module) API(V1,V2) request and response XML files. for this i have found usefule [link][http://www.techytalk.info/magento-extension-for-logging-soap-v1-and-v2-api-requests/]1, it uses

public function call($sessionId, $apiPath, $args = array())
    {
        Mage::helper('inchoo_soaplogger/v1')
            ->logPostXml();

        return parent::call($sessionId, $apiPath, $args);
    }

With this i can save request xml file, but i could not achieve response xml file, we do not have method callResponse to call from parent.

Please help me on how to save both response and request API XML files.

3

All the SOAP cals go through the method Mage_Api_Model_Server_Adapter_Soap::run

there is an if-else statement in there. The if branch generates the WSDL, you don't need to log that.
On the else branch you get the response as XML from the line $this->_soap->handle().
Log that response.

For the xmlrpc calls everything passes through Mage_Api_Model_Server_Adapter_Xmlrpc::run.
And the response is generated by the code $this->_xmlRpc->handle().

  • I have used Mage::log($this->_soap->handle(),null,'wsdl.log'); and Mage::log($this,null,'wsdl.log'); but i could not see any log file – prasad maganti Aug 21 '15 at 13:13
  • I could log Mage_Api_Model_Server_V2_Adapter_Soap::run method, but its giving wsdl structure, but i want in XML structure, how to acheive in XML format. – prasad maganti Aug 21 '15 at 13:21
  • on the else branch you should not get the wsdl. you should get the response. – Marius Aug 21 '15 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.