CentraSite Documentation : Runtime Governance with CentraSite : Important Considerations when Configuring REST or XML Virtual Services : Working with the JSON Content-Type : JSON Example 3: GET Request, XML Response
JSON Example 3: GET Request, XML Response
In this example, a consumer sends a GET request to get a native service. Mediator will send the response to the consumer in the requested XML format (as indicated by the "output=xml" parameter in the query).
The request looks like this:
http://localhost:5555/ws/YahooVS/search?query=wsdl20&output=xml
and because this is a GET request, the Content-Type defaults to application/x-www-form-urlencoded.
The run-time processing will be as follows:
Consumer Sends
Mediator Sends Request to Provider
Mediator Receives Response from Provider
Mediator Sends Response to Consumer
Requirement for Bridging
GET
GET
JSON
XML
*Request Processing step bridging
*Response Processing step bridging
Since the request is a GET (that is, of Content-Type application/x-www-form-urlencoded), but Mediator expects to receive a JSON stream from the provider, you must instruct Mediator to send the BUILDER_TYPE application/json to the native provider. To do this, write and invoke a webMethods IS service in the virtual service’s Invoke webMethods IS Service action. The IS service should include the following predefined context variable set to this value:
Context Variable
Value
BUILDER_TYPE
application/json
Since the provider will return a JSON stream to Mediator, but the consumer expects to receive the service in XML output format, you must set the MESSAGE_TYPE to application/xml. To do this, write and invoke a webMethods IS service in the virtual service’s Invoke webMethods IS Service action. The IS service should include the following predefined context variable set to this value:
Context Variable
Value
MESSAGE_TYPE
application/xml
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback