title: How can I unmarshal an XML response to 2 java objects using JAXB when there are 2 namespaces?
body: <p>Thank you for taking the time to read.</p>
  <p>My goal is to deserialize the response from an API request into 2 usable java objects.</p>
  <p>I am sending an POST request to an endpoint to create a job in our schedule. The job is created successfully and the following XML is returned in the body:</p>
  <pre><code>&lt;entry xmlns=&quot;http://purl.org/atom/ns#&quot;&gt;
      &lt;id&gt;0&lt;/id&gt;
      &lt;title&gt;Job has been created.&lt;/title&gt;
      &lt;source&gt;com.tidalsoft.framework.rpc.Result&lt;/source&gt;
      &lt;tes:result xmlns:tes=&quot;http://www.auto-schedule.com/client&quot;&gt;
          &lt;tes:message&gt;Job has been created.&lt;/tes:message&gt;
          &lt;tes:objectid&gt;42320&lt;/tes:objectid&gt;
          &lt;tes:id&gt;0&lt;/tes:id&gt;
          &lt;tes:operation&gt;CREATE&lt;/tes:operation&gt;
          &lt;tes:ok&gt;true&lt;/tes:ok&gt;
          &lt;tes:objectname&gt;Job&lt;/tes:objectname&gt;
      &lt;/tes:result&gt;
  &lt;/entry&gt;
  </code></pre>
  <p>When I attempt to only capture the elements <strong>id</strong>, <strong>title</strong>, and <strong>source</strong> the data is captured successfully. The problem is when I introduce the child object, which attempts to capture the data in the <strong>tes:result</strong> element.</p>
  <p>Here's what the parent POJO looks like:</p>
  <pre><code>@XmlRootElement(name = &quot;entry&quot;)
  @XmlAccessorType(XmlAccessType.FIELD)
  public class Response {
  
      private String id;
  
      private String title;
  
      private String source;
  
      ResponseDetails result;
  
      public Response() {}
  }
  </code></pre>
  <p>and here is the child object:</p>
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  public class ResponseDetails {
  
      @XmlElement(name = &quot;tes:message&quot;)
      String message;
      
      @XmlElement(name = &quot;tes:objectid&quot;)
      String objectid;
  
      @XmlElement(name = &quot;tes:operation&quot;)
      String operation;
  
      @XmlElement(name = &quot;tes:ok&quot;)
      String ok;
  
      @XmlElement(name = &quot;tes:objectname&quot;)
      String objectname;
  }
  </code></pre>
  <p>Finally, here is the package-info.java file I am using:</p>
  <pre><code>@XmlSchema(
          namespace = &quot;http://purl.org/atom/ns#&quot;,
          elementFormDefault = XmlNsForm.QUALIFIED)
  package com.netspend.raven.tidal.request.response;
  
  import javax.xml.bind.annotation.XmlNsForm;
  import javax.xml.bind.annotation.XmlSchema;
  </code></pre>
  <p>Any ideas are greatly appreciated. Thanks.</p>