3

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?

2

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

  • If it solved your problem, please accept your own answer. – sv3n Feb 26 '18 at 19:15

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.