Demonstrate the ability of Synapse to receive raw TCP messages and send them to HTTP endpoints
This sample is similar to Sample 250. Only difference is instead of the JMS transport we will be using the TCP transport to receive messages. TCP is not an application layer protocol. Hence there are no application level headers available in the requests. Synapse has to simply read the XML content coming through the socket and dispatch it to the right proxy service based on the information available in the message payload itself. The TCP transport is capable of dispatching requests based on addressing headers or the first element in the SOAP body. In this sample, we will get the sample client to send WS-Addressing headers in the request. Therefore the dispatching will take place based on the addressing header values.
Invoke the stockquote client using the following command. Note the TCP URL in the command.
The TCP transport will receive the message and hand it over to the mediation engine. Synapse will dispatch the request to the StockQuoteProxy service based on the addressing header values.
When the proxy service forwards the message to the sample Axis2 server over HTTP, sample server will print the following entry to confirm that the request has been received.