HI ,

I enabled wire logs and below are the logs.

[2018-08-23 16:16:14,601] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >>
"GET /scale/scale HTTP/1.1[\r][\n]"
[2018-08-23 16:16:14,601] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >>
"Accept-Encoding: gzip,deflate[\r][\n]"
[2018-08-23 16:16:14,605] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >>
"Host: 192.168.80.87:8280[\r][\n]"
[2018-08-23 16:16:14,607] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >>
"Connection: Keep-Alive[\r][\n]"
[2018-08-23 16:16:14,608] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >>
"User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
[2018-08-23 16:16:14,609] [] DEBUG - wire HTTP-Listener I/O dispatcher-4 >>
"[\r][\n]"
[2018-08-23 16:16:14,610] [] DEBUG - headers http-incoming-4 >> GET
/scale/scale HTTP/1.1
[2018-08-23 16:16:14,610] [] DEBUG - headers http-incoming-4 >>
Accept-Encoding: gzip,deflate
[2018-08-23 16:16:14,611] [] DEBUG - headers http-incoming-4 >> Host:
192.168.80.87:8280
[2018-08-23 16:16:14,611] [] DEBUG - headers http-incoming-4 >> Connection:
Keep-Alive
[2018-08-23 16:16:14,612] [] DEBUG - headers http-incoming-4 >> User-Agent:
Apache-HttpClient/4.1.1 (java 1.5)

I don't exactly know what is the problem, as i do see that the message is
landing on the TCP server and the TCP server is replying however the same i
am unable ti get in wso2 esb, is there any property which i need to set so
that it works in a synchronous manner.



Regards,

Amit Gupta

On Thu, Aug 23, 2018 at 2:29 PM Amit Gupta <amit.elcar...@gmail.com> wrote:

> Hi ,
>
> I am working on TCP socket communcation with wso2 ESB.
>
> I was able to send message to TCP server however once the TCP server is
> replying back i cannot see the message in wso3 esb, could you please help
> me with this.
>
> API :
>
> <api xmlns="http://ws.apache.org/ns/synapse"; name="ScalesAPI"
> context="/scale">
>    <resource methods="GET" url-mapping="/scale">
>       <inSequence>
>          <property name="REST_URL_POSTFIX" scope="axis2" action="remove"/>
>          <property name="OUT_ONLY" value="true"/>
>          <payloadFactory media-type="text">
>             <format>&amp;lt;RN&amp;gt;</format>
>             <args/>
>          </payloadFactory>
>          <call>
>             <endpoint>
>                <address uri="tcp://192.168.80.87:8915"/>
>             </endpoint>
>          </call>
>          <log level="custom">
>             <property name="After Call" expression="."/>
>          </log>
>       </inSequence>
>       <outSequence>
>          <log level="custom">
>             <property name="Into Out Sequence" expression="."/>
>          </log>
>       </outSequence>
>    </resource>
> </api>
>
>
>
> JAVA Code :
> public class TCPServer {
>
> public static void main(String[] args) throws Exception {
> String clientSentence;
> String name = "Amit";
>   String capitalizedSentence = "&lt; 00 23 &gt;";
>   ServerSocket welcomeSocket = new ServerSocket(8915);
>
>   while (true) {
>    Socket connectionSocket = welcomeSocket.accept();
>    BufferedReader inFromClient =
>     new BufferedReader(new
> InputStreamReader(connectionSocket.getInputStream()));
>    DataOutputStream outToClient = new
> DataOutputStream(connectionSocket.getOutputStream());
>    clientSentence = inFromClient.readLine();
>    System.out.println("Received: " + clientSentence);
>   // capitalizedSentence = clientSentence.toUpperCase() + 'n';
>    System.out.println("Received1: " + clientSentence);
>   //outToClient.writeBytes(capitalizedSentence);
>
>    PrintStream p = new PrintStream(connectionSocket.getOutputStream());
>
>    p.println(capitalizedSentence);
>
>    outToClient.close();
>    System.out.println("Received2: " + clientSentence);
>    inFromClient.close();
>    connectionSocket.close();
>   }
>
> }
>
> }
>
>
>
> Logs :
>
> [2018-08-23 14:28:54,732] []  INFO - LogMediator After Call = <?xml
> version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
> http://www.w3.org/2003/05/soap-envelope";><soapenv:Body><axis2ns43:text
> xmlns:axis2ns43="http://ws.apache.org/commons/ns/payload
> ">&amp;lt;RN&amp;gt;</axis2ns43:text></soapenv:Body></soapenv:Envelope>
>
>
>
>
> Regards,
>
> Amit Gupta
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to