title: JAXB unmarshaling Ignoring the SOAP Envelope/Header tags
body: <p>I have a client I am building for accessing a web service. I am using some JAXB generated classes(Netbeans 6.9) to unmarshal my xml data. </p>
  
  <p>I am getting unexpected element errors when trying to unmarshal the InputStream response from this webservice, I also get the same unexpected element error if I save the response to a file.</p>
  
  <pre><code>javax.xml.bind.UnmarshalException: unexpected element (uri:"http://www.w3.org/2003/05/soap-envelope", local:"Envelope"). Expected elements are &lt;{http://www.cmicdataservices.com/}Authentication&gt;,....
  </code></pre>
  
  <p>With the data saved to file I can go in and delete the SOAP tags(envelope,body,headr) and then run the unmarshaling with no problem.</p>
  
  <p>I have not really found a way to make the unmarshaling ignore these tags.  Does anyone know what can be done to ignore those tags?</p>
  
  <p>Here is the main method and the class returned by the stream.</p>
  
  <pre><code>   public static void main(String[] args) {
          JAXBContext jaxbContext = null;
          try {
              CMICData cmic = new CMICData();
              jaxbContext = JAXBContext.newInstance("cmic.ajrs.com");
              Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
  
  
              GetCurrentDataVer1Response response = (GetCurrentDataVer1Response)
                      unmarshaller.unmarshal( cmic.getCMICIs("GetCurrentDataVer1"));
              DatacenterDataVer1 dataSet = response.getGetCurrentDataVer1Result();
  
              List products = dataSet.getAProductBase().getProductBase();
              // print some primary keys to show data being processed.
              for(Iterator&lt;ProductBase&gt; iter = products.iterator(); iter.hasNext();) {
                  ProductBase pb = iter.next();
                  System.out.println(pb.getPkID());
              }
  
          } catch (JAXBException ex) {
              Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
          }
          catch (IOException ex) {
              Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
          }
  
  
      }
  </code></pre>
  
  <p>The class generated by Netbeans.</p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "", propOrder = {
      "getCurrentDataVer1Result"
  })
  @XmlRootElement(name = "GetCurrentDataVer1Response", namespace = "http://www.cmicdataservices.com/")
  public class GetCurrentDataVer1Response {
  
      @XmlElement(name = "GetCurrentDataVer1Result")
      protected DatacenterDataVer1 getCurrentDataVer1Result;
  
      /**
       * Gets the value of the getCurrentDataVer1Result property.
       * 
       * @return
       *     possible object is
       *     {@link DatacenterDataVer1 }
       *     
       */
      public DatacenterDataVer1 getGetCurrentDataVer1Result() {
          return getCurrentDataVer1Result;
      }
  
      /**
       * Sets the value of the getCurrentDataVer1Result property.
       * 
       * @param value
       *     allowed object is
       *     {@link DatacenterDataVer1 }
       *     
       */
      public void setGetCurrentDataVer1Result(DatacenterDataVer1 value) {
          this.getCurrentDataVer1Result = value;
      }
  
  }
  </code></pre>