title: Howto parse xml-tags with prefixes using jersey and jaxb
body: <p>I'm trying to parse XML-data which has prefixes.</p>
  <p>I'm using Java: Jersey with Jaxb -librarys.</p>
  <p>How to do I tell Annanotation: @XmlRootElement-to,
  that my xml has prefixes?</p>
  <p>My root element is like <code>&lt;soapenv:Envelope&gt;</code>.</p>
  <p>should my do Annotation like:</p>
  <pre><code>@XmlRootElement(name=&quot;soapenv:Envelope&quot;) // I'll get HTTP 400 Bad request
  </code></pre>
  <p>or</p>
  <pre><code>@XmlRootElement(name=&quot;/soapenv:Envelope&quot;) // I'll get HTTP 400 Bad request
  </code></pre>
  <p>or</p>
  <pre><code>@XmlRootElement(name=&quot;Envelope&quot; namespace&quot;soapenv:&quot;) // Don't remeber what I get, propably HTTP 400
  </code></pre>
  <p>or</p>
  <pre><code>@XmlRootElement(name=&quot;Envelope&quot; ) //With this I'll get NullPointerException
  </code></pre>
  <p>XML-code that I need to parse:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot;?&gt;
  &lt;soapenv:Envelope xmlns=&quot;http://someurl-1&quot; xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
      &lt;soapenv:Body&gt;
          &lt;customerID&gt;CID1&lt;/customerID&gt;
          &lt;companyName&gt;some company name&lt;/companyName&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  <p>My java-class looks like this:</p>
  <pre class="lang-java prettyprint-override"><code>import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlRootElement;
  
  @XmlRootElement(name = &quot;ns:response&quot;) // something is wrong
  public class MyXMLClass {
      @XmlElement(name = &quot;soapenv:Body&quot; )
      public Body body;
  }
  </code></pre>
  <p>I'd tried to make my easier xml-code, without prefixes and I got my code to work,
  but I need to work it with prefixes.</p>
  <p>I tried to search from net also, it seems that this topic has very little info.
  &quot;
  I also tried to put <code>@XmlElement</code> before, or after the <code>@XmlRootElement</code>, to tell what is actual element, but already javac told me it's not possible to use it that way:</p>
  <pre><code>@XmlElement(name = &quot;soapenv:Envelope&quot; )
  @XmlRootElement
  public class MyXMLClass {
  ...
  </code></pre>
  <p>So anyway: <strong>How to parse xml-tags with prefixes?</strong></p>