Enterprise Integration Zone is brought to you in partnership with:

Enterprise Architect in HCL Technologies a $7Billion IT services organization. My role is to work as a Technology Partner for large enterprise customers providing them low cost opensource solutions around Java, Spring and vFabric stack. I am also working on various projects involving, Cloud base solution, Mobile application and Business Analytics around Spring and vFabric space. Over 23 yrs, I have build repository of technologies and tools I liked and used extensively in my day to day work. In this blog, I am putting all these best practices and tools so that it will help the people who visit my website. Krishna is a DZone MVB and is not an employee of DZone and has posted 64 posts at DZone. You can read more from them at their website. View Full User Profile

Managing Raw SOAP message within Spring Integration – Part 2

  • submit to reddit

In my earlier blog, Managing Raw SOAP message within Spring Integration, I demonstrated how to get the raw SOAP message from int-http:inbound-gateway and process the SOAP message.

There are few scenarios, where in the Spring Integration flow is invoked by an event. Where Spring Integration flow, should get a payload from source Webservice and just transfer it to target Webservice, acting as a Proxy, retaining all the properties of the source and target systems.

In this blog I will demonstrate how you can create a Proxy and how int-ws-outbound-gateway can call the Proxy service when calling Source Webservice. If you notice int-ws-outbound-gateway carefully, we can configure the security keystore and other properties. These properties will be retained, when the payload is passed to the Proxy. Once the request payload is in the Proxy, it can be sent to the source Webservice and once we get the response, we can bind it to another channel, which can be processed further or sent to the target Webservice.

Managing Raw SOAP message within Spring Integration

Managing Raw SOAP message within Spring Integration

<int:channel id="ws.outbound" />

 <int-ws:outbound-gateway id="ws.gateway"
 request-channel="ws.inbound" reply-channel="ws.outbound"
 ignore-empty-responses="true" message-sender="common.message.sender.ws"
 uri="http://localhost:8080/http-proxy-for-ws/receiveGateway" />

 <int-http:inbound-gateway id="http.proxy.gateway"
 request-channel="http.proxy.inbound" name="/receiveGateway"
 supported-methods="POST" />

 <int:channel id="http.proxy.inbound" />

 <int:service-activator input-channel="http.proxy.inbound"
 id="httpProxyServiceActivator" ref="httpProxyServiceActivatorBean"
 method="sendXml" />

 <int:channel id="http.proxy.outbound" />

 <bean id="httpProxyServiceActivatorBean">
 <property name="uri"
 value="http://www.webservicex.net/CurrencyConvertor.asmx" />
 <property name="soapAction" value="http://www.webserviceX.NET/ConversionRate" />
 <property name="wsOutboundChannel" ref="http.proxy.outbound" />

 <int:service-activator input-channel="http.proxy.outbound"
 id="finalProcessorServiceActivator" ref="finalProcessorServiceActivatorBean"
 method="sendXml" />

 <bean id="finalProcessorServiceActivatorBean" />

Published at DZone with permission of Krishna Prasad, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)