title: TCP transport in Proxy wso2 esb
body: <p>I want to send a request over TCP transport to a proxy service, when use this code to send my soap xml </p>
  
  <pre><code>Socket clientSocket = new Socket("host", port);
  
  DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
  
  outToServer.writeBytes("soap xml instance");
  
  clientSocket.close();
  </code></pre>
  
  <p>it works fine and my business is continues.</p>
  
  <p>But when i send two xml without closing the socket like this:</p>
  
  <pre><code>Socket clientSocket = new Socket("host", port);
  
  DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
  
  outToServer.writeBytes("soap xml instance");
  
  outToServer.writeBytes("another soap instance");
  
  clientSocket.close();
  </code></pre>
  
  <p>it always throws this exception:</p>
  
  <blockquote>
    <p>TID: [0] [ESB] [2013-06-28 13:36:10,838] ERROR
    {org.apache.axis2.transport.tcp.TCPWorker} -  Error while processing
    TCP request through the Axis2 engine
    {org.apache.axis2.transport.tcp.TCPWorker}
    org.apache.axiom.om.OMException:
    com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction
    target ("xml"); xml (case insensitive) is reserved by the specs.  at
    [row,col {unknown-source}]: [2,5]
            at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
            at org.apache.axiom.om.impl.llom.OMDocumentImpl.buildNext(OMDocumentImpl.java:135)
            at org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:122)
            at org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:343)
            at org.apache.axiom.om.impl.traverse.OMChildrenIterator.getNextNode(OMChildrenIterator.java:36)
            at org.apache.axiom.om.impl.traverse.OMAbstractIterator.hasNext(OMAbstractIterator.java:58)
            at org.jaxen.util.DescendantAxisIterator.hasNext(DescendantAxisIterator.java:101)
            at org.jaxen.expr.DefaultStep.evaluate(DefaultStep.java:152)
            at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140)
            at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113)
            at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
            at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
            at org.jaxen.BaseXPath.selectNodes(BaseXPath.java:213)
            at org.jaxen.BaseXPath.evaluate(BaseXPath.java:172)
            at org.apache.synapse.util.xpath.SynapseXPath.stringValueOf(SynapseXPath.java:297)
            at org.apache.synapse.mediators.builtin.PropertyMediator.getResultValue(PropertyMediator.java:299)
            at org.apache.synapse.mediators.builtin.PropertyMediator.mediate(PropertyMediator.java:95)
            at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:71)
            at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:114)
            at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:154)
            at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
            at org.apache.axis2.transport.tcp.TCPWorker.run(TCPWorker.java:68)
            at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:662) Caused by: com.ctc.wstx.exc.WstxParsingException: Illegal processing instruction
    target ("xml"); xml (case insensitive) is reserved by the specs.  at
    [row,col {unknown-source}]: [2,5]
            at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
            at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:479)
            at com.ctc.wstx.sr.BasicStreamReader.readPIPrimary(BasicStreamReader.java:3903)
            at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2037)
            at com.ctc.wstx.sr.BasicStreamReader.closeContentTree(BasicStreamReader.java:2886)
            at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2629)
            at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1062)
            at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
            at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
            at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
            at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
            at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
            ... 25 more</p>
  </blockquote>
  
  <p>I used appending '\n', "\r\n" to my message but non of them make that work. </p>
  
  <p>Also i tried that used the method that explined in this link.<a href="http://axis.apache.org/axis2/java/transports/tcp-transport.html" rel="nofollow">How to Send SOAP Messages Using TCP Transport</a> and it worked fine.</p>
  
  <p>But i could not use that kind of api in my project. How can i get rid of this problem.</p>