title: CDATA section in SOAP Request XML
body: <p>I am using a JAX-WS service. Following is the part of request class.</p>
  
  <pre><code>@XmlElement(name = "Answers") 
  protected String answers;
  </code></pre>
  
  <p>Now, in the actual SOAP request, the answers need to be sent in the xml as CDATA. There is a separate stub class for answers. Hence, I am marshalling the object of that class into an xml. I am surrounding this in CDATA tags as shown below:</p>
  
  <pre><code>xmlstr = "&lt;![CDATA[" + xmlstr + "]]&gt;"; 
  </code></pre>
  
  <p>Hence, my request xml should look like this:</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;S:Body&gt;
      &lt;!-- Other tags --&gt;
      &lt;Answers&gt;
          &lt;![CDATA[
              &lt;TagOne&gt;&lt;/TagOne&gt;
              &lt;TagTwo&gt;&lt;/TagTwo&gt;
          ]]&gt;
      &lt;/Answers&gt;
  &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>However, when the request is sent to server, from the SOAPLoggingHandler, it looks like this:</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;S:Body&gt;
      &lt;!-- Other tags --&gt;
      &lt;Answers&gt;
          &amp;lt;![CDATA[
              &amp;lt;TagOne&gt;&amp;lt;/TagOne&amp;gt;&amp;#13;
              &amp;lt;TagTwo&gt;&amp;lt;/TagTwo&amp;gt;&amp;#13;
          ]]&amp;gt;&amp;#13;
      &lt;/Answers&gt;
  &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>Due to this escaping of characters, I am receiving the response saying "Invalid Answers xml format". I have 2 questions:</p>
  
  <ol>
  <li><p>Is xmlstr = "" the correct way to create a CDATA xml from a bean? If not then, is there any standard way to do that?</p></li>
  <li><p>If I want to send the CDATA section in request without escaping, which changes should I make into my implementation?</p></li>
  </ol>
  
  <p>Let me know if anything else is required.</p>