AdroitLogic Private Ltd.

  • Increase font size
  • Default font size
  • Decrease font size

Proxy to and from FastInfoset with the UltraESB

This example shows a Proxy service capable of mediating a Jax-WS service, and additionally accepting FastInfoset requests and forwarding them to non-FastInfoset compatible backend services by converting the requests to regular XML. The responses from the backend services are converted again to FastInfoset requests, and sent back to the clients.

 

It should be noted that in the example as shown below, we remove the "Accept" encoding header as a transport header to the backend service to prevent the backend service from replying in FastInfoset back to the proxy..

<u:proxy id="jax-ws-proxy">
<u:transport id="http-8280"/>
<u:target>
<u:inSequence>
<u:java><![CDATA[
Mediation.convertFromFI(msg);
msg.setContentType("text/xml");
msg.removeTransportHeader("Accept");
]]></u:java>
</u:inSequence>
<u:inDestination>
<u:address>http://localhost:9000/service/SimpleStockQuoteService</u:address>
</u:inDestination>
<u:outSequence>
<u:java><![CDATA[
Mediation.convertToFI(msg);
msg.setContentType("application/fastinfoset");
]]></u:java>
</u:outSequence>
<u:outDestination>
<u:address type="response"/>
</u:outDestination>
</u:target>
</u:proxy>

To try out this sample, start the sample configuration 202 of the UltraESB through the ToolBox, or the command line as follows

asankha@asankha:~/java/ultraesb-1.0-beta-1/bin$ ./ultraesb.sh -sample 202

Now start the sample Jetty server and the HTTP/S client from the Toolbox, and issue a Preset "1" request to the URL http://localhost:8280/service/jax-ws-proxy and you will receive a FastInfoset encoded response back