Magento 1.9 – SOAP API V2 Response Log

apimagento-1.9soapsoap-api-v2

I'm trying to debugging SOAP API. I'm logging call Requests,
but how would I get log on Response?

I have tried to use Magento-API-Logger to get Response I've added

$logger->log($this->getResponse(), $logger::API_V2_SOAP);

to the V2/SoapController, but that gets response without body and it's not XML

DEBUG (7): Mage_Core_Controller_Response_Http Object
(
    [_body:protected] => Array
        (
        )

    [_exceptions:protected] => Array
        (
        )

    [_headers:protected] => Array
        (
            [0] => Array
                (
                    [name] => Content-Type
                    [value] => text/html; charset=UTF-8
                    [replace] => 
                )

            [1] => Array
                (
                    [name] => X-Frame-Options
                    [value] => SAMEORIGIN
                    [replace] => 1
                )

        )

    [_headersRaw:protected] => Array
        (
        )

    [_httpResponseCode:protected] => 200
    [_isRedirect:protected] => 
    [_renderExceptions:protected] => 
    [headersSentThrowsException] => 1
)

Any Suggestions how to get response log?

Best Answer

John suggested good thread which mention nice extension N98_ApiLogger. It logs API requests and responses. All logs are displayed in admin backend.

I found another way. by adding mage log to Soap.php. I was looking for Wsi v2 so my file is app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php

around line 102 just after closing try block, add

Mage::log($content, null, 'response-api.log');

Thanks

Related Topic