Wednesday, May 4, 2016

Generate a file using the request payload and send to a backend via WSO2 ESB

Let's say WSO2 ESB receives an request with a payload, and we need to create a file using that payload content and send that file to a endpoint.

Here's the required proxy cofiguration.

This sequence builds the message as a multipart/form-data and send it to the endpoint.

If you want to customise MultipartFormDataFormatter, write your own class extending MultipartFormDataFormatter.

Configure it in WSO2_ESB/repository/conf/axis2/axis2.xml file as follows.

This org.wso2.custom.CustomMultipartFormDataFormatter sets the file name as filename.xml, Content-Type as text/xml and payload as the content of the file


No comments: