Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
JAXB解组失败_Jaxb_Unmarshalling - Fatal编程技术网

JAXB解组失败

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

解组响应字符串(xml格式)时出现以下错误。最初它抱怨and,所以我从响应中删除了soap部分。现在它出现了这个错误

类是使用JAXB2从提供的WSDL创建的

**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();**