I'm trying to connect a web service ( SOAP, write with Spring WS ) to a linux service ( it was write in C and send data to xxxx port ). I need to send string data to this system and receive a response and then web service send data by SOAP to the customers. I'm using Spring Integration to connect through TCP ( sockets ), but I maybe dont understand the framework architecture. I suppose my web service is the client and the linux system is the server, so I configure a tcp-inbound-gateway ( because I need the response and to control a timeout ) but in testing send data and then connection close inmediately, I need to know how to wait and to capture the response to be able send by method's web service ( EndPoint )
method web service :Code:<int-ip:tcp-connection-factory id="client" type="client" host="localhost" port="8001" single-use="true" so-timeout="10000" /> <int-ip:tcp-outbound-gateway id="outGateway" request-channel="requestChannel" reply-channel="replyChannel" connection-factory="client" request-timeout="100000" reply-timeout="100000" /> <int:channel id="replyChannel"/> <int:channel id="requestChannel" />
Code:@PayloadRoot(namespace = NAMESPACE_URI, localPart = REQUEST_LOCAL_NAME) @ResponsePayload public WSResponse processRequest(@RequestPayload WSRequest wsRequest) { Message<String> message = MessageBuilder.withPayload("DATA").build(); MessageChannel channel = channelResolver.resolveChannelName("requestChannel"); boolean x = channel.send(message,10000); // so, this code doesnt wait for response. .... }


Reply With Quote