Announcement Announcement Module
Collapse
No announcement yet.
how to invoke a web service from spring integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to invoke a web service from spring integration

    Hi!

    Im trying to call a webservice from inside spring integration. So I found in the documentation: http://static.springsource.org/sprin...e/html/ws.html

    So in my context according to the documentation Ive:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans:beans xmlns="http://www.springframework.org/schema/integration"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:beans="http://www.springframework.org/schema/beans"
    	xmlns:stream="http://www.springframework.org/schema/integration/stream"
    	xmlns:ws="http://www.springframework.org/schema/integration/ws"
    	xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:sws="http://www.springframework.org/schema/web-services"
    	xmlns:oxm="http://www.springframework.org/schema/oxm"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
           		http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    			http://www.springframework.org/schema/integration
    			http://www.springframework.org/schema/integration/spring-integration.xsd
    			http://www.springframework.org/schema/integration/stream
    			http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
    			http://www.springframework.org/schema/integration/ws
    			http://www.springframework.org/schema/integration/ws/spring-integration-ws.xsd
      	 		http://www.springframework.org/schema/web-services
    			http://www.springframework.org/schema/web-services/web-services-2.0.xsd
    			http://www.springframework.org/schema/oxm
    			http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd">
    
    	<beans:bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"
    	p:contextPath="org.krams.tutorial.oxm.server"/>
    
    	<ws:outbound-gateway id="marshallingGateway"
         request-channel="requestChannel"
         uri="http://192.168.4.145:7001/holaMundo/HelloImplService"
         marshaller="jaxbMarshaller"
         unmarshaller="jaxbMarshaller"/>
    </beans:beans>
    Basically my webservice receives an string an returns the same string.

    So my question is, how do I call the webservice from my main class?

    Thanks in advance.

  • #2
    You can create the ApplicationContext and then grab the 'requestChannel' from it within the main. Or you can add a gateway and inject that: http://static.springsource.org/sprin...eway-namespace

    Comment

    Working...
    X