title: SOAP Message format to Socket Message format conversion and vice versa using Java
body: <p>I am currently researching SOAP Message format to Socket Message format conversion and vice versa using Java.</p>
  
  <p>I need this to reuse a legacy system that reads socket format message to connect to a website that sends and receives SOAP message format.</p>
  
  <p>How should I do this? Should I consider text processing?</p>
  
  <p>Sample Socket to SOAP</p>
  
  <p>SOCKET</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;Interface Code="20" 
        &lt;Transaction Txn="01880120121024000001" CD="01880120121024000001001" 
       Date="2012-10-24 17:27:25"  BirthDate="1983-03-27" Code="8110009000000720" Type="0"/&gt;
  &lt;/Interface&gt;
  </code></pre>
  
  <p>SOAP</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   &lt;soapenv:Body&gt;
    &lt;webRequest xmlns="http://____________"&gt;
     &lt;arg0 xmlns=""&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"
      standalone="yes"?&gt;&amp;lt;Interface xmlns="http://____________"
      Version="1.0" Code="20" Txn="123" CD="456"&gt;&amp;lt;Info
      BirthDate="1983-03-27" Code="1234" Type="0" /&gt;&amp;lt;/Interface&gt;&lt;/arg0&gt;
    &lt;/webRequest&gt;
   &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>