JAXB解组失败
解组响应字符串(xml格式)时出现以下错误。最初它抱怨and,所以我从响应中删除了soap部分。现在它出现了这个错误 类是使用JAXB2从提供的WSDL创建的JAXB解组失败,jaxb,unmarshalling,Jaxb,Unmarshalling,解组响应字符串(xml格式)时出现以下错误。最初它抱怨and,所以我从响应中删除了soap部分。现在它出现了这个错误 类是使用JAXB2从提供的WSDL创建的 **javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ws.taxwareenterprise.com", local:"calculateDocumentResponse"). Expected elements are (none) at co
**javax.xml.bind.UnmarshalException: unexpected element (uri:"http://ws.taxwareenterprise.com", local:"calculateDocumentResponse"). Expected elements are (none)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)**
这是我的响应字符串(它的一部分)
**<calculateDocumentResponse xmlns="http://ws.taxwareenterprise.com">
<txDocRslt>
<jurSumRslts>
<jurSumRslt>
<xmptAmt>5.0</xmptAmt>
<txableAmt>15.0</txableAmt>
<txAmt>0.04</txAmt>
<txJurUID>...**
<xs:complexType name="CalculationResponse">
<xs:sequence>
<xs:element name="txDocRslt" type="tns:TxDocRslt"/>
</xs:sequence>
</xs:complexType>
**final JAXBContext context = JAXBContext.newInstance(CalculationResponse.class);
final Unmarshaller unmarshaller = context.createUnmarshaller();
response = processResponse(response);//for removing soap headers
responseObj = (CalculationResponse) unmarshaller.unmarshal(new StringReader(response));//Fails here...
final TxDocRslt txDocRslt = responseObj.getTxDocRslt();**