Getting raw XML SOAP-response on client side using ADB-stubs created by AXIS2

前端 未结 5 1722
天涯浪人
天涯浪人 2021-01-04 21:30

I access a SOAP service using ADB-stubs created by AXIS2. I would like to log the raw XML response of any Axis Fault, that is returned by the service. I can catch those erro

5条回答
  •  执念已碎
    2021-01-04 22:05

    Below is what you probably are looking for, yourStub is what you generated via wsdl2java and use below lines after you make your request. The message is set to lastOperation and sends it when you make the actual call:

    request = yourStub._getServiceClient().getLastOperationContext().getMessageContext("Out")
                  .getEnvelope().toString());
    
    response = yourStub._getServiceClient().getLastOperationContext().getMessageContext("In")
                  .getEnvelope().toString());
    

    Hope that was helpful.

提交回复
热议问题