Announcement Announcement Module
Collapse
No announcement yet.
Gateway Webservice and Chain together Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gateway Webservice and Chain together

    Hello All,

    I'd like to user Gateway Webservice and chain together, use Gateway for sync call, Webservice to be client of WS, Chain to process(convert transform so..) the result.
    Gateway
    Code:
    <int:gateway id="gw" default-request-channel="someChannel" 
        service-interface="foo.MyInterface"/>

    Code:
    ...
        @Autowired
        private MyInterface gw;
    ...
    
        String response = gw.sendAndReceive(request);
    ...

    Code:
    public interface MyInterface {
    
        String sendAndReceive(String request);

    Webservice
    Code:
    <chain input-channel="fahrenheitChannel" output-channel="celsiusChannel">
    		<ws:header-enricher>
    			<ws:soap-action value="http://tempuri.org/CelsiusToFahrenheit" />
    		</ws:header-enricher>
    		<ws:outbound-gateway
    			uri="http://www.w3schools.com/webservices/tempconvert.asmx" />
    	</chain>
    How to process the reply by chain and put all code together?
    thank

  • #2
    If I correctly understand you, you need something like this:
    HTML Code:
    <chain input-channel="fahrenheitChannel">
    		<ws:header-enricher>
    			<ws:soap-action value="http://tempuri.org/CelsiusToFahrenheit" />
    		</ws:header-enricher>
    		<ws:outbound-gateway
    			uri="http://www.w3schools.com/webservices/tempconvert.asmx" />
                 <si-xml:unmarshalling-transformer unmarshaller="" />
                  <transformer ref=""/>
    	</chain>
    However 'Gateway for sync call', the first one, should be configured separately. It is one of channel adapters. The gateway interface should live with channel together.

    Or give more info, please

    Artem Bilan

    Comment


    • #3
      Thanks Artem,
      i'd like to call WS using SI by sync way (like usual call to WS send and receive in one line: String reply = ws.sendAndReceive(payload); )
      I see a lot of samples from git repository. I can't put all together: use tcp-client-server sample for sync gateway and ws-outbound-gateway for ws call and chain using. i do not understand how to go from gateway to chain with ws inside it.

      Comment


      • #4
        Don't warry! And change your mind.
        You are already armed with channel, so use it as some abstraction for communication two adapters: tcp and chain with WS-gateway.
        It's OK. And my advice: don't speculate on chains - you may catch some problems.

        Comment

        Working...
        X