How to save raw XML or json payload for debugging purposes?
Introduction: #
We have added a new feature regarding Generate Raw Payload. This function uses to debug and define the error in case the data is not correctly transformed. It will create a file and link to the API or parent message, and you will see its original state. To use this function, you need to have checked the “Raw logging Payload” field in the inbound and outbound interface. For inbound processing is not support with ASYNC Mode.
Pre-requisite: #
⦁ Upload or create SOAP Message Type.
⦁ Create Integration and two Interfaces for Request and Response.
⦁ Create SOAP Adapter.
⦁ Check box Generate Raw payload on Interfaces.
1.How to save raw XML payload for debugging purposes?
Step1: Upload or create SOAP Message Type.
⦁ Here’s SOAP Message Type.
Step2: Create Integration and two Interfaces, linked with message type, and check flag Generate Raw payload.
⦁ Here’s Request Interface.
Scroll down to see the flag Generate Raw payload? Here’s Example
⦁ Do mapping. Here’s Example
⦁ Here’s Response Interface that linked with message type. Here’s Example.
Linked Response Interfaces with Request Interface.
Step3: Now select the manual process.
Select the Database Query statement as shown in fig.
Step 4: We will get the result as screenshot below. You will get the request and response message to cover the business message.
Here is the result: We will get raw logging payload file link to the request api message.
Here is the xml payload of log payload file.
2.How to save raw json payload for debugging purposes?
Pre-requisite:
Step 1:
⦁ Create Integration and Request/Response Interface
⦁ Outbound adapter “REST” and link with request interface.
⦁ Message type for REST for request and Response.
⦁ Create REST adapter using with mock service.
Linked Response Interfaces with Request Interface.
Scroll down to see the flag Generate Raw payload? Here’s Example
Step 2:Do mapping and save it.
Step 3:create new rest adapter
Step 4:check on message monitoring and Click on Message name of API Message.
Step 5:Click Raw Logging Payload.
Here’s the raw payload of Request Interface
SUMMARY
So in this we have learnt the purpose is to log the request and response for debugging of the api call. The ‘generate raw payload’ should not always be activated because it generate to much file storage.We should not always set this mode to run only if it is needed in error analyze use case.