We have native restful services that accept and generate only JSON content. We need to bridge these services for an XML only consumer. Currently we have configured the virtual rest service in the following way:
In the Request Processing step of the Virtual REST Service, we have two flow services -
o one to set the BUILDER_TYPE to application/json (to be able to parse the JSON response received from the native service),
o and the other to set the MESSAGE_TYPE to application/json (to be able to serialize the request to JSON before sending it to the native service).
In the Response Processing step of the Virtual REST Service, we have one flow service to set the MESSAGE_TYPE to application/xml (to be able to build the XML response to send to the consumer).
With this configuration, we are getting a successful HTTP 200 status, however the response obtained is empty.
When we remove the response processing step from the VS and redeploy, we are able to see the JSON response being sent by mediator , so that means the request conversion from XML to JSON is happening correctly, and the mediator is able to send the JSON request to the native service and obtain a JSON response from it. This same JSON response is then being fwded by mediator to the client. However, when we add the response processing service (as mentioned above), that response is somehow being transformed to an empty string with Content-Length 0.