...
If you want to use the sample Axis2 client to send TCP messages, uncomment the TCP transport sender configuration in the following file:
<EI_HOME>/samples/axis2Client/client_repo/conf/axis2.xml
Info |
---|
The TCP transport supports sending messages from a Web Socket to a TCP channel. |
Table of Contents | ||
---|---|---|
|
...
Code Block | ||
---|---|---|
| ||
<proxy name="TCPProxy"
transports="tcp"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="symbol" value="IBM" scope="default" type="STRING"/>
<enrich>
<source type="inline" clone="true">
<m:getQuote xmlns:m="http://services.samples">
<m:request>
<m:symbol>?</m:symbol>
</m:request>
</m:getQuote>
</source>
<target type="body"/>
</enrich>
<enrich>
<source type="property" clone="true" property="symbol"/>
<target xmlns:m="http://services.samples" xpath="//m:getQuote/m:request/m:symbol"/>
</enrich>
<log level="full" separator=","/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
<parameter name="transport.tcp.responseClient">true</parameter>
<parameter name="transport.tcp.recordDelimiter">|</parameter>
<parameter name="transport.tcp.inputType">string</parameter>
<parameter name="transport.tcp.port">6789</parameter>
<parameter name="transport.tcp.recordDelimiterType">character</parameter>
<parameter name="transport.tcp.contentType">text/xml</parameter>
</proxy>
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
</div> |
...
Splitting by a special character
The sample proxy below splits the input message by appending a special character to the end of the message.
Code Block | ||
---|---|---|
| ||
<proxy name="TCPProxy"
transports="tcp"
startOnLoad="true"
trace="disable">
<description/>
<target>
<inSequence>
<property name="symbol" value="IBM" scope="default" type="STRING"/>
<enrich>
<source type="inline" clone="true">
<m:getQuote xmlns:m="http://services.samples">
<m:request>
<m:symbol>?</m:symbol>
</m:request>
</m:getQuote>
</source>
<target type="body"/>
</enrich>
<enrich>
<source type="property" clone="true" property="symbol"/>
<target xmlns:m="http://services.samples" xpath="//m:getQuote/m:request/m:symbol"/>
</enrich>
<log level="full" separator=","/>
<send>
<endpoint>
<address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/>
</endpoint>
</send>
</inSequence>
<outSequence>
<log level="full"/>
<send/>
</outSequence>
</target>
<parameter name="transport.tcp.recordDelimiter">0x03</parameter>
<parameter name="transport.tcp.responseClient">true</parameter>
<parameter name="transport.tcp.inputType">binary</parameter>
<parameter name="transport.tcp.port">6789</parameter>
<parameter name="transport.tcp.recordDelimiterType">byte</parameter>
<parameter name="transport.tcp.contentType">text/xml</parameter>
</proxy> |
Splitting by a character sequence
The sample proxy below splits the input message by appending a special character to the end of the messagesequence of characters.
Code Block | ||
---|---|---|
| ||
<proxy name="TCPProxy" transports="tcp" startOnLoad="true" trace="disable"> <description/> <target> <inSequence> <property name="symbol" value="IBM" scope="default" type="STRING"/> <enrich> <source type="inline" clone="true"> <m:getQuote xmlns:m="http://services.samples"> <m:request> <m:symbol>?</m:symbol> </m:request> </m:getQuote> </source> <target type="body"/> </enrich> <enrich> <source type="property" clone="true" property="symbol"/> <target xmlns:m="http://services.samples" xpath="//m:getQuote/m:request/m:symbol"/> </enrich> <log level="full" separator=","/> <send> <endpoint> <address uri="http://localhost:9000/services/SimpleStockQuoteService" format="soap11"/> </endpoint> </send> </inSequence> <outSequence> <log level="full"/> <send/> </outSequence> </target> <parameter name="transport.tcp.recordDelimiterresponseClient">0x03<>true</parameter> <parameter name="transport.tcp.responseClientrecordDelimiter">true<>split</parameter> <parameter name="transport.tcp.inputType">binary<>string</parameter> <parameter name="transport.tcp.port">6789</parameter> <parameter name="transport.tcp.recordDelimiterType">byte<>string</parameter> <parameter name="transport.tcp.contentType">text/xml</parameter> </proxy> |
Developing the Java Client for the Transport
...