0
votes

I'm using IBM API connect & IBM DataPower 2018.

I have a SOAP web service, and I need to do some customized logging for it by capturing the request\response payload.

When the service returns a valid XML, or even SOAP exception, I could easily handle such cases, and save the request\response payload in separate DB schema for operational purposes.

I updated the response payload by returning non XML response from the backend, like "ABCDEFGHI....". when I call this service through datapower, it returns clear response.

<errorResponse>
   <httpCode>400</httpCode>
   <httpMessage>Bad Request</httpMessage>
   <moreInformation>Invalid XML payload received.</moreInformation>
</errorResponse>

But I am unable to capture the message.body payload which is in my case "ABCDEFGHI..", the apim.getvariable('message.body') returns nothing.

My question: How to capture the invalid response payload (none well XML) for SOAP service by using Gateway script?

1

1 Answers

1
votes

You can't... as the the message will be rejected prior to processing since DataPower will set the message type to SOAP it will reject anything not being SOAP. You would need to pass it through a "chaining" API (or service on the DataPower instance) which could capture the response payload.