Re: [Dev] Sending Data Over TCP

2018-08-23 Thread Amit Gupta
Below are the logs.

[2018-08-23 09:32:59,279] []  INFO - LogMediator To:
/services/TestProxy.TestProxyHttpSoap11Endpoint, WSAction: urn:mediate,
SOAPAction: urn:mediate, MessageID:
urn:uuid:04f974ac-5825-4743-b674-54a3d9060f9f, Direction: request,
Envelope: http://schemas.xmlsoap.org/soap/envelope/;>

   Amit
   
[2018-08-23 09:33:00,284] [] ERROR - TCPTransportSender Error while opening
TCP connection to : tcp://192.168.80.87:8092
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at
java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at
org.apache.axis2.transport.tcp.TCPTransportSender.openTCPConnection(TCPTransportSender.java:167)
at
org.apache.axis2.transport.tcp.TCPTransportSender.sendMessage(TCPTransportSender.java:52)
at
org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at
org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:595)
at
org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:83)
at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:548)
at
org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at
org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:65)
at
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:234)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:404)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[2018-08-23 09:33:00,288] [] ERROR - Axis2Sender Unexpected error during
sending message out
org.apache.axis2.AxisFault: Error while opening TCP connection to : tcp://
192.168.80.87:8092
at
org.apache.axis2.transport.base.AbstractTransportSender.handleException(AbstractTransportSender.java:226)
at
org.apache.axis2.transport.tcp.TCPTransportSender.openTCPConnection(TCPTransportSender.java:170)
at
org.apache.axis2.transport.tcp.TCPTransportSender.sendMessage(TCPTransportSender.java:52)
at
org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at
org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at
org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:595)
at
org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:83)
at
org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:548)
at
org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:382)
at
org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:65)
at
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:234)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:404)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at 

Re: [Dev] Sending Data Over TCP

2018-08-23 Thread Amit Gupta
Hi Thishani ,

Untill yesterday things were working fine however today i am getting
connection refused error, Could you please help me with this, below is my
proxy and sample java code.


Proxy service :


http://ws.apache.org/ns/synapse;
   name="TestProxy"
   startOnLoad="true"
   statistics="disable"
   trace="disable"
   transports="http">
   
  
 
 
  
  
 
  
   
   




Sample TCP Server JAVA Code:

public class TCPServer {

public static void main(String[] args) throws Exception {
String clientSentence;
  String capitalizedSentence;
  ServerSocket welcomeSocket = new ServerSocket(8902);

  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);


   outToClient.close();
   System.out.println("Received2: " + clientSentence);
   inFromClient.close();
   connectionSocket.close();
  }

}

}



Regards,

Amit Gupta

On Tue, Aug 21, 2018 at 5:30 PM Amit Gupta  wrote:

> Thank you Thishani ,
>
> I updated the proxy with the example and tried however i am getting same
> issue.
>
> 
> http://ws.apache.org/ns/synapse;
>name="TestProxy"
>startOnLoad="true"
>statistics="disable"
>trace="disable"
>transports="http">
>
>   
>  
>  
>   
>   
>  
>   
>
>
> 
>
>
> Below are the logs
>
> [2018-08-21 17:26:35,672] []  INFO - DeploymentInterceptor Deploying Axis2
> service: TestProxy {super-tenant}
> [2018-08-21 17:26:35,673] []  INFO - ProxyService Successfully created the
> Axis2 service for Proxy service : TestProxy
> [2018-08-21 17:26:45,484] []  WARN - JavaLogger potential cross-site
> request forgery (CSRF) attack thwarted (user:,
> ip:192.168.80.106, method:POST,
> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
> token is missing from the request)
> [2018-08-21 17:27:09,121] []  WARN - JavaLogger potential cross-site
> request forgery (CSRF) attack thwarted (user:,
> ip:192.168.80.106, method:POST,
> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
> token is missing from the request)
> [2018-08-21 17:27:12,305] []  WARN - JavaLogger potential cross-site
> request forgery (CSRF) attack thwarted (user:,
> ip:192.168.80.106, method:POST,
> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
> token is missing from the request)
>
>
>
> The IP 192.168.80.106 is my system.Can you let me know what is going wrong
>
> On Tue, Aug 21, 2018 at 5:25 PM Thishani Lucas  wrote:
>
>> Hi Amit,
>>
>> As I have answered in [1], we need a TCP endpoint in the send mediator.
>>
>> [1]
>> https://stackoverflow.com/questions/51947933/sending-data-over-tcp-on-wso2-esb
>>
>> Thanks,
>> Thishani
>>
>> On Tue, Aug 21, 2018 at 7:53 PM, Amit Gupta 
>> wrote:
>>
>>> Hi Lahirumadu ,
>>>
>>> Thank you for the response .
>>>
>>> I had gone through the documentation and  was little confused, Like when
>>> ESB needs to send data over TCP then IP and port of the TCP server is
>>> required however here we just mention Port, So my scenario is that ESB
>>> should be able to send data over TCP to another server and once the server
>>> responds with a message then ESB should further do the enrich the response.
>>>
>>> Regards,
>>>
>>> Amit Gupta
>>>
>>> On Tue, Aug 21, 2018 at 4:18 PM Lahiru Madushanka 
>>> wrote:
>>>
 Hi Amit,

 Please refer to this [1] documentation. ( contains a sample )

 [1] https://docs.wso2.com/display/ESB500/TCP+Transport

 Thanks,
 Lahiru

 On Tue, Aug 21, 2018 at 5:28 PM Amit Gupta 
 wrote:

> Hi ,
>
> I have created a proxy in wso2 esb wherin i can receive data over TCP
> from external parties.
> However my requirement is that i need to develop a proxy wherein esb
> sends request over TCP and then receives a response and then process the
> response further.
>
> Any leads on this or any example will be helpful for me.
>
> Thanks,
>
> Amit Gupta
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>

>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Thishani Lucas*
>> *Software Engineer*
>> *WSO2 Lanka (Private) Limited**: http://wso2.com *
>> *lean.enterprise.middle-ware*
>>
>> *Tel: +94 77 

Re: [Dev] Sending Data Over TCP

2018-08-21 Thread Amit Gupta
Thank you Thishani ,

I updated the proxy with the example and tried however i am getting same
issue.


http://ws.apache.org/ns/synapse;
   name="TestProxy"
   startOnLoad="true"
   statistics="disable"
   trace="disable"
   transports="http">
   
  
 
 
  
  
 
  
   
   



Below are the logs

[2018-08-21 17:26:35,672] []  INFO - DeploymentInterceptor Deploying Axis2
service: TestProxy {super-tenant}
[2018-08-21 17:26:35,673] []  INFO - ProxyService Successfully created the
Axis2 service for Proxy service : TestProxy
[2018-08-21 17:26:45,484] []  WARN - JavaLogger potential cross-site
request forgery (CSRF) attack thwarted (user:,
ip:192.168.80.106, method:POST,
uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
token is missing from the request)
[2018-08-21 17:27:09,121] []  WARN - JavaLogger potential cross-site
request forgery (CSRF) attack thwarted (user:,
ip:192.168.80.106, method:POST,
uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
token is missing from the request)
[2018-08-21 17:27:12,305] []  WARN - JavaLogger potential cross-site
request forgery (CSRF) attack thwarted (user:,
ip:192.168.80.106, method:POST,
uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
token is missing from the request)



The IP 192.168.80.106 is my system.Can you let me know what is going wrong

On Tue, Aug 21, 2018 at 5:25 PM Thishani Lucas  wrote:

> Hi Amit,
>
> As I have answered in [1], we need a TCP endpoint in the send mediator.
>
> [1]
> https://stackoverflow.com/questions/51947933/sending-data-over-tcp-on-wso2-esb
>
> Thanks,
> Thishani
>
> On Tue, Aug 21, 2018 at 7:53 PM, Amit Gupta 
> wrote:
>
>> Hi Lahirumadu ,
>>
>> Thank you for the response .
>>
>> I had gone through the documentation and  was little confused, Like when
>> ESB needs to send data over TCP then IP and port of the TCP server is
>> required however here we just mention Port, So my scenario is that ESB
>> should be able to send data over TCP to another server and once the server
>> responds with a message then ESB should further do the enrich the response.
>>
>> Regards,
>>
>> Amit Gupta
>>
>> On Tue, Aug 21, 2018 at 4:18 PM Lahiru Madushanka 
>> wrote:
>>
>>> Hi Amit,
>>>
>>> Please refer to this [1] documentation. ( contains a sample )
>>>
>>> [1] https://docs.wso2.com/display/ESB500/TCP+Transport
>>>
>>> Thanks,
>>> Lahiru
>>>
>>> On Tue, Aug 21, 2018 at 5:28 PM Amit Gupta 
>>> wrote:
>>>
 Hi ,

 I have created a proxy in wso2 esb wherin i can receive data over TCP
 from external parties.
 However my requirement is that i need to develop a proxy wherein esb
 sends request over TCP and then receives a response and then process the
 response further.

 Any leads on this or any example will be helpful for me.

 Thanks,

 Amit Gupta
 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev

>>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Thishani Lucas*
> *Software Engineer*
> *WSO2 Lanka (Private) Limited**: http://wso2.com *
> *lean.enterprise.middle-ware*
>
> *Tel: +94 77 2556931 *
>
> *LinkedIn: https://www.linkedin.com/in/thishani-lucas/
> *
>
>
> 
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Sending Data Over TCP

2018-08-21 Thread Thishani Lucas
Hi Amit,

As I have answered in [1], we need a TCP endpoint in the send mediator.

[1]
https://stackoverflow.com/questions/51947933/sending-data-over-tcp-on-wso2-esb

Thanks,
Thishani

On Tue, Aug 21, 2018 at 7:53 PM, Amit Gupta  wrote:

> Hi Lahirumadu ,
>
> Thank you for the response .
>
> I had gone through the documentation and  was little confused, Like when
> ESB needs to send data over TCP then IP and port of the TCP server is
> required however here we just mention Port, So my scenario is that ESB
> should be able to send data over TCP to another server and once the server
> responds with a message then ESB should further do the enrich the response.
>
> Regards,
>
> Amit Gupta
>
> On Tue, Aug 21, 2018 at 4:18 PM Lahiru Madushanka 
> wrote:
>
>> Hi Amit,
>>
>> Please refer to this [1] documentation. ( contains a sample )
>>
>> [1] https://docs.wso2.com/display/ESB500/TCP+Transport
>>
>> Thanks,
>> Lahiru
>>
>> On Tue, Aug 21, 2018 at 5:28 PM Amit Gupta 
>> wrote:
>>
>>> Hi ,
>>>
>>> I have created a proxy in wso2 esb wherin i can receive data over TCP
>>> from external parties.
>>> However my requirement is that i need to develop a proxy wherein esb
>>> sends request over TCP and then receives a response and then process the
>>> response further.
>>>
>>> Any leads on this or any example will be helpful for me.
>>>
>>> Thanks,
>>>
>>> Amit Gupta
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Thishani Lucas*
*Software Engineer*
*WSO2 Lanka (Private) Limited**: http://wso2.com *
*lean.enterprise.middle-ware*

*Tel: +94 77 2556931 *

*LinkedIn: https://www.linkedin.com/in/thishani-lucas/
*



___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Sending Data Over TCP

2018-08-21 Thread Amit Gupta
Hi Lahirumadu ,

Thank you for the response .

I had gone through the documentation and  was little confused, Like when
ESB needs to send data over TCP then IP and port of the TCP server is
required however here we just mention Port, So my scenario is that ESB
should be able to send data over TCP to another server and once the server
responds with a message then ESB should further do the enrich the response.

Regards,

Amit Gupta

On Tue, Aug 21, 2018 at 4:18 PM Lahiru Madushanka 
wrote:

> Hi Amit,
>
> Please refer to this [1] documentation. ( contains a sample )
>
> [1] https://docs.wso2.com/display/ESB500/TCP+Transport
>
> Thanks,
> Lahiru
>
> On Tue, Aug 21, 2018 at 5:28 PM Amit Gupta 
> wrote:
>
>> Hi ,
>>
>> I have created a proxy in wso2 esb wherin i can receive data over TCP
>> from external parties.
>> However my requirement is that i need to develop a proxy wherein esb
>> sends request over TCP and then receives a response and then process the
>> response further.
>>
>> Any leads on this or any example will be helpful for me.
>>
>> Thanks,
>>
>> Amit Gupta
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Sending Data Over TCP

2018-08-21 Thread Lahiru Madushanka
Hi Amit,

Please refer to this [1] documentation. ( contains a sample )

[1] https://docs.wso2.com/display/ESB500/TCP+Transport

Thanks,
Lahiru

On Tue, Aug 21, 2018 at 5:28 PM Amit Gupta  wrote:

> Hi ,
>
> I have created a proxy in wso2 esb wherin i can receive data over TCP from
> external parties.
> However my requirement is that i need to develop a proxy wherein esb sends
> request over TCP and then receives a response and then process the response
> further.
>
> Any leads on this or any example will be helpful for me.
>
> Thanks,
>
> Amit Gupta
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Sending Data Over TCP

2018-08-21 Thread Amit Gupta
Hi ,

I have created a proxy in wso2 esb wherin i can receive data over TCP from
external parties.
However my requirement is that i need to develop a proxy wherein esb sends
request over TCP and then receives a response and then process the response
further.

Any leads on this or any example will be helpful for me.

Thanks,

Amit Gupta
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev