Thursday, April 10, 2014

TCP Transport in Proxy WSO2 ESB

Its simple you need do following steps

First make sure you have enabled transport reciver for tcp in axis2.xml (repository/conf/axis2/axis2.xml)

<transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportListener" />
<transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns=""
         <log level="full"/>
   <parameter name="transport.tcp.port">6789</parameter>
   <parameter name="transport.tcp.contentType">application/xml</parameter>


class TCPClient {
String host = "localhost";
int port = 6789;
Socket socket = null;

public static void main(String args[]) throws Exception {
String name = "Amani";
TCPClient client = new TCPClient();
// String message =
//                 "<soapenv:Envelope xmlns:soapenv=\"\" xmlns:xsd=\"\" xmlns:xsi=\"\">\n" +
//                         "<soapenv:Header/>\n" +
//                         "<soapenv:Body>\n" +
//                         "  <p:greet xmlns:p=\"\">\n" +
//                         "     <in>" +
//                         name +
//                         "</in>\n" +
//                         "  </p:greet>\n" +
//                         "</soapenv:Body>\n" + "</soapenv:Envelope>";

TCPClient(String _host, int _port) throws Exception {
host = _host;
port = _port;
socket = new Socket(host, port);

TCPClient() throws Exception {
socket = new Socket(host, port);

void SendToServer(String msg) throws Exception {
// create output stream attached to socket
PrintWriter outToServer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream()));
// send msg to server
outToServer.print(msg + '\n');

String RecieveFromServer() throws Exception {
// create input stream attached to socket
BufferedReader inFromServer =
                             new BufferedReader(
                                                new InputStreamReader(
// read line from server
String res = inFromServer.readLine(); // if connection closes on server
 // end, this throws
return res;

void close() throws IOException {


  1. This was a really great contest and hopefully I can attend the next one. It was alot of fun and I really enjoyed myself..
    swiss taxi

  2. You can locate another proxy ordinary and access all sites you need to see despite the fact that they are blocked. mexico vpn

  3. They utilize tools that you simply do not have access to that enables them to track the transport company's safety record, driver history, insurance coverage, or fraudulent activity (if any).john deere

  4. Hi Dushan ,

    I got a use case where I want some wso2 component to call HSM hardware for ISO-1 PIN block format when we send normal text pin.

  5. True, this can add some time in your quest for the best auto transport companies, but we live in difficult economic times and getting the best deal on something is very important.move it move it

  6. There are distinctive sorts of Proxies and they all have diverse capacities and abilities. As said above, you can download and introduce a Proxy program that interfaces you to another PC's port.

  7. Personally, I have found that to remain probably the most fascinating topics when it draws a parallel to. You may find two to three new levels inside L . a . Weight loss and any one someone is incredibly important. Initial stage may be real melting away rrn the body. lose weight Learn more

  8. In fact your creative writing abilities has inspired me to start my own Blog Engine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it scopri di piu

  9. Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. VPN

  10. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. privacy online

  11. “Sometimes I feel like if you just watch things, just sit still and let the world exist in front of you - sometimes I swear that just for a second time freezes and the world pauses in its tilt. Just for a second. And if you somehow found a way to live in that second, then you would live forever.” prywatnoscwsieci

  12. The article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful

  13. The data you have posted is extremely valuable. The locales you have alluded was great. A debt of gratitude is in order for sharing...

  14. I essentially discovered your site page and expected that would state that I have truly respected the experience of looking on the web diary sections. lesmeilleursvpn

  15. This is my first time i visit here. I found such a substantial number of interesting stuff in your blog especially its examination. Really its inconceivable article. Keep it up. netflix vpn

  16. On the off chance that no information is exchanged through the Contivity association for a significant lot of time, 15 minutes or more, the Contivity VPN Switch naturally separates the association;

  17. road networks pass through cities, towns and villages and provide better connectivity options in addition to city rail networks and are ideal for public transport also.таможенное-оформление-в-литве/

  18. I have bookmarked your website because this site contains valuable information in it. I am really happy with articles quality and presentation. Thanks a lot for keeping great stuff. I am very much thankful for this site. lesmeilleursvpn

  19. You have done a great job. I will definitely dig it and personally recommend to my friends. I am confident they will be benefited from this site. Klik hier

  20. The overall simplicity of turning into an internet business vendor and setting up stores results in such an immense number of contributions that customers can undoubtedly be overpowered.

  21. It is true that most damage occurs while carrying, loading and unloading, but it is also true that if movers (or yourself) do not load the truck properly some items will get damaged in transit. شركات نقل الاثاث يالاسكندرية

  22. This comment has been removed by the author.

  23. It's additionally a smart thought to call your vehicle rental organization or survey their site to decide the terms and approach of the tenant contract. cancun car rental

  24. Say Kuwait national transport company offers the best service for transporting Kuwait Unpacking the installation of packaging of household appliances with the preservation of furniture parts Furniture You are safe with the best transport companies in Kuwait Transporting all areas in Kuwait نقل عفش

  25. Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. نقل عفش

  26. The server runs serenely in the secluded condition, so you are constantly protected from the security and steadiness issues made by different clients. vps

  27. This is a truly good site post. Not too many people would actually. the way you just did. I am really impressed that there is so much information about this subject that have been uncovered and you’ve done your best. with so much class. If wanted to know more about green smoke reviews. than by all means come in and check our stuff. nemzetközi szállítmányozás

  28. I would state, you do the genuinely amazing.This substance is made to a wonderful degree well. BAMA

  29. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work.

  30. Very good written article. It will be supportive to anyone who utilizes it, including me. Keep doing what you are doing – can’r wait to read more posts. 1337x

  31. Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. 1337x