@@ -720,7 +720,7 @@ public Object unmarshal(Source source, MimeContainer mimeContainer) throws XmlMa
720720 return unmarshalStaxSource (unmarshaller , source );
721721 }
722722 else if (this .mappedClass != null ) {
723- return unmarshaller .unmarshal (source , this .mappedClass );
723+ return unmarshaller .unmarshal (source , this .mappedClass ). getValue () ;
724724 }
725725 else {
726726 return unmarshaller .unmarshal (source );
@@ -734,12 +734,16 @@ else if (this.mappedClass != null) {
734734 protected Object unmarshalStaxSource (Unmarshaller jaxbUnmarshaller , Source staxSource ) throws JAXBException {
735735 XMLStreamReader streamReader = StaxUtils .getXMLStreamReader (staxSource );
736736 if (streamReader != null ) {
737- return jaxbUnmarshaller .unmarshal (streamReader );
737+ return (this .mappedClass != null ?
738+ jaxbUnmarshaller .unmarshal (streamReader , this .mappedClass ).getValue () :
739+ jaxbUnmarshaller .unmarshal (streamReader ));
738740 }
739741 else {
740742 XMLEventReader eventReader = StaxUtils .getXMLEventReader (staxSource );
741743 if (eventReader != null ) {
742- return jaxbUnmarshaller .unmarshal (eventReader );
744+ return (this .mappedClass != null ?
745+ jaxbUnmarshaller .unmarshal (eventReader , this .mappedClass ).getValue () :
746+ jaxbUnmarshaller .unmarshal (eventReader ));
743747 }
744748 else {
745749 throw new IllegalArgumentException ("StaxSource contains neither XMLStreamReader nor XMLEventReader" );
0 commit comments