REST XML-JSON Mediation

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:

  1. 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).

  2. 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.

im able to deploy my virtual rest servie to mediator.

what is the endpoint for calling rest service already deploy to mediator?
i tried “http://host:port/ws/virtual_rest_name” and “http://host:port/rest/virtual_rest_name”. But failed!

Can not find the answer also in documentation.

thanks

Hello Janardhan,

You have to provide the resource name as well to the input uri

For example: http://<is_host>:/ws/service_name/resource_name

Hi Janardan Kelkar,

We are facing the issue. If you find any resolution, can you please post the details

Thanks & Regards,
Jeevan