0

I need to remove the node from SOAP API response Magento 2. Below is an example. From:

<env:Body>
    <ns1:customTestAuthV1CallbackResponse>
        <result>
            <resultCode>1</resultCode>
            <resultMessage>response message</resultMessage>
        </result>
    </ns1:customTestAuthV1CallbackResponse>
</env:Body>

To

<env:Body>
    <ns1:customTestAuthV1CallbackResponse>
        <resultCode>1</resultCode>
        <resultMessage>response message</resultMessage>
    </ns1:customTestAuthV1CallbackResponse>
</env:Body>

I have created a module to remove the node from response but it is throwing an error as seen below

<env:Fault>
    <env:Code>
        <env:Value>env:Receiver</env:Value>
    </env:Code>
    <env:Reason>
        <env:Text>SOAP-ERROR: Encoding: object has no 'result' property</env:Text>
    </env:Reason>
</env:Fault>

Does anyone have any idea how can we remove the node?

2
  • can anyone have the solution? Commented Sep 28, 2021 at 11:52
  • 1
    when you remove and send the response back it won't accept the response since it require node with name "result" you have to return it
    – Asad Ullah
    Commented Sep 28, 2021 at 13:39

0

Your Answer

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

Browse other questions tagged or ask your own question.