Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Managing Raw SOAP message within Spring Integration – Part 2

DZone's Guide to

Managing Raw SOAP message within Spring Integration – Part 2

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

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" />
 </bean>

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

 <bean id="finalProcessorServiceActivatorBean" />
 

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:

Published at DZone with permission of Krishna Prasad, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}