AdroitLogic Private Ltd.

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

Proxying SOAP messages with the UltraESB

This example demonstrates a simple SOAP Proxy service, and the use of request filters to make service resources such as WSDL's, XSD's available at the same URL of a service.

In this example, the HTTP transport listener is decorated with the ServiceResourceRequestFilter, that will detect ?wsdl and ?xsd suffixes in requests, and serve the requested resource without passing the request into the proxy service for mediation. The transport lister is configured as shown below to enable the request filter.

    <bean id="http-8280" class="org.adroitlogic.ultraesb.transport.http.HttpNIOListener">
<constructor-arg ref="fileCache"/>
<property name="port" value="8280"/>
<property name="requestFilters">
<list>
<bean class="org.adroitlogic.ultraesb.transport.http.ServiceResourceRequestFilter">
<property name="resourcePrefix" value="http://localhost:8280"/>
</bean>
</list>
</property>
</bean>

The property 'resourcePrefix' defined against the ServiceResourceRequestFilter gives the URL prefix for the service location shown in the WSDL and also the externally visible URL for the resources such as the WSDL and XSDs. This allows one to define the externally visible hostname/domain etc.

The Proxy service itself is a simple definition as shown below. It defines the base URL for the service WSDL - which can be specified as a local file, or by pointing to the WSDL from a real backend service.

    <u:proxy id="soap-proxy">
<u:transport id="http-8280">
<!--<u:property name="wsdlURL" value="file:resources/samples/resources/SimpleStockQuoteService.wsdl"/>-->
<u:property name="wsdlURL" value="http://localhost:9000/service/SimpleStockQuoteService?wsdl"/>
</u:transport>
<u:target>
<u:inDestination>
<u:address>http://localhost:9000/service/SimpleStockQuoteService</u:address>
</u:inDestination>
<u:outDestination>
<u:address type="response"/>
</u:outDestination>
</u:target>
</u:proxy>

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

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

Now start the sample Jetty server through the ToolBox, and then pointing your browser to http://localhost:8280/service/soap-proxy?wsdl will show you the re-written WSDL for the proxy service, based on the original WSDL supplied. Note that as the UltraESB does not validate, parse or change the WSDL - you can make the UltraESB show any WSDL you wish - exactly as you want! It will only point the service location to the proxy service, and update the schema references to be correct and available through the proxy service itself as shown below. In the example below, the 'resourcePrefix' was set to "http://asankha:8280" and thus appears appropriately as expected.

 

 

To test the proxy service with a SOAP request, start the HTTP/S client of the ToolBox, and issue a Preset "1" request payload against the Proxy service URL http://localhost:8280/service/soap-proxy.

You may also be interested to look at the Original WSDL at URL http://localhost:9000/service/SimpleStockQuoteService?wsdl and see the modifications done by the Proxy when displaying it to the end clients.