Change the format of the content
We follow this use case when we already have content in the payload, but it might not be in the format that we need; for example, when our service receives a request in a specific format but the backend is waiting for a different format, or the backend sends us a message and we need to modify it to format the response to the client. The best way to do this is with the use of Message type.
Message type
Message type is a synapse property that defines the message format of the current payload. Here's the syntax:
<property name="messageType" value="string" scope="axis2"/>
In our flight example, we will change the response of the EI service to return the same information of the backend, but in the JSON format. So, the only change that we need to make is to configure the messageType
property in the out sequence of our service to change the format of the payload to JSON:
<property name="messageType" value="application/json" ...