Results 1 to 4 of 4

Thread: Gateway Webservice and Chain together

  1. #1
    Join Date
    Apr 2012
    Posts
    14

    Default 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. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    637

    Default

    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

  3. #3
    Join Date
    Apr 2012
    Posts
    14

    Default

    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.

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    637

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •