title: Generating SOAP XML from POJO
body: <p>Hello for loging and debuging purpose I need to store input POJO of spring bean in DB in SOAP XML form. Can you help me which library i can use and do you have some code examples how to create SOAP XML from POJO object. I try to use javax.xml.soap.* to generate SOAP Envelope, Header and Body, and JAXB for generating xml from POJO. javax.xml.soap.* works fine, but i have problem with namespaces in POJO xml. Is there way to generate namespaces automaticaly? For example...</p>
  
  <p>My output without namespaces is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;SOAP-ENV:Header/&gt;
    &lt;SOAP-ENV:Body&gt;
      &lt;z:getClientDetail xmlns:z="my.package"&gt;
      &lt;client&gt;
        &lt;adresses&gt;
          &lt;city&gt;Praha&lt;/city&gt;
          &lt;houseNumber&gt;1455&lt;/houseNumber&gt;
          &lt;street&gt;Hudeckova&lt;/street&gt;
        &lt;/adresses&gt;
        &lt;adresses&gt;
          &lt;city&gt;Brno&lt;/city&gt;
          &lt;houseNumber&gt;44&lt;/houseNumber&gt;
          &lt;street&gt;Tupolevova&lt;/street&gt;
        &lt;/adresses&gt;
        &lt;firstName&gt;Standa&lt;/firstName&gt;
        &lt;lastName&gt;Vrana&lt;/lastName&gt;
      &lt;/client&gt;
   &lt;/z:getClientDetail&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>But correct output with namespace is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;SOAP-ENV:Header/&gt;
    &lt;SOAP-ENV:Body&gt;
      &lt;z:getClientDetail xmlns:z="my.package"&gt;
      &lt;java:client xmlns:java="my.package.dto"&gt;
      &lt;java:adresses&gt;
        &lt;java:city&gt;Praha&lt;/city&gt;
        &lt;java:houseNumber&gt;1455&lt;/houseNumber&gt;
        &lt;java:street&gt;Hudeckova&lt;/street&gt;
      &lt;/java:adresses&gt;
      &lt;java:adresses&gt;
        &lt;java:city&gt;Brno&lt;/city&gt;
        &lt;java:houseNumber&gt;44&lt;/houseNumber&gt;
        &lt;java:street&gt;Tupolevova&lt;/street&gt;
      &lt;/java:adresses&gt;
      &lt;java:firstName&gt;Standa&lt;/firstName&gt;
      &lt;java:lastName&gt;Vrana&lt;/lastName&gt;
     &lt;/java:client&gt;
    &lt;/z:getClientDetail&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>Thanks P.</p>