When the request xml with extra elements, return Unmarshalling Error in CXF 2.2.7

Posted by yunchat on Stack Overflow See other posts from Stack Overflow or by yunchat
Published on 2010-04-29T10:24:44Z Indexed on 2010/04/29 10:27 UTC
Read the original article Hit count: 518

Filed under:
|
|
|

The wsdl as following:

<xs:complexType name="GetCompositionDto"> <xs:complexContent>
<xs:extension base="tns:baseDto">
<xs:sequence>
<xs:element minOccurs="0" name="itemCode" type="xs:string"/>
<xs:element minOccurs="0" name="compositionVersion" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>

After I updated the CXF the jars. from cxf-2.1.4, jaxb-Impl-2.1.9, jaxb-xjc-2.1.9 To cxf-2.2.7, jaxb-Impl-2.1.12, jaxb-xjc-2.1.12.

When I request the XML with following:

<itemCode>aa</itemCode>
<compositionVersion>bb</compositionVersion>
<h>22</h> --- extra element

Displays Errors: Unmarshalling Error: unexpected element (uri:"", local:"h"). Expected elements are <{}itemCode>,<{}compositionVersion>

I know the 'h' doesn't map the element in WSDL. But It's OK in the cxf-2.1.4 version.

How can i solve this problem? thanks.

© Stack Overflow or respective owner

Related posts about soap

Related posts about cxf