Hi,
I am using an http:inbound-gateway for processing a request on server and sending the response back to the client.
The problem is that it always returns null.
Here is my configuration:
I even tried using chain:Code:<int-http:inbound-gateway id="testAdapter.htm" request-channel="testChannel" name="/testAdapter.htm" reply-channel="testGatewayChannel" supported-methods="GET" view-name="defaultJsonView"/> <int:service-activator ref="testConverter" input-channel="testChannel" output-channel="testGatewayChannel" /> <bean id="testConverter" class="com.messaging.MessageReceiver" /> <bean id="testSender" class="com.messaging.ReplySender"/> <int:service-activator ref="testSender" input-channel="testGatewayChannel" method="sendMessage" />
But still got the same response as null.Code:<int:chain input-channel="testChannel" output-channel="testGatewayChannel"> <int:service-activator ref="testConverter" /> <int:service-activator ref="testSender" method="sendMessage" /> </int:chain>
And here is my Sender Class which sends the response
I am getting response as null on my client side.Code:public class ReplySender { public String sendMessage(Message<?> message) { try { System.out.println("in ReplySender sendMessage " + message.getPayload()); } catch (Exception e) { e.printStackTrace(); } return message.getPayload().toString(); } }
Where am i going wrong?Am i using the right method?
Which is the best method for returning a response to the client?
Please help.
Thanks in advance..


Reply With Quote
