0

我收到以下错误:

[8/13/13 12:36:14:261 CAT] 00000024 SystemOut     O /com/acme/integration/Verify       Error calling VerifyService
  javax.xml.ws.WebServiceException: org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException: An internal assertion error occurred. The com.acme.services.VerifyFault JAXB object does not have a VerifyResult xml property.
    at org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl.unWrap(JAXBWrapperToolImpl.java:84)
    at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller.demarshalResponse(DocLitWrappedMethodMarshaller.java:144)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createResponse(JAXWSProxyHandler.java:440)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:351)
    at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:159)
    at $Proxy46.verify(Unknown Source)

wsdl 的(删减)摘录:

        <xsd:element name="verify">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="1" name="Type" type="xsd:int" />
                    <xsd:element minOccurs="1" name="Number" nillable="true" type="xsd:string" />
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="verifyResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="VerifyResult" type="xsd:int" />
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
        <xsd:element name="verify_fault">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element minOccurs="0" name="Code" nillable="true" type="xsd:string" />
                    <xsd:element minOccurs="0" name="Message" nillable="true" type="xsd:string" />
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

我从导致错误的服务(在 SOAPUI 中)得到的响应:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <NS1:verify_fault xmlns:NS1="http://www.acme.com">
         <Code>RecordNotFound</Code>
         <Message>No Records Found.</Message>
      </NS1:verify_fault>
   </soapenv:Body>
</soapenv:Envelope>

任何有助于理解为什么我会在JAXBWrapperException逻辑上得到响应中不应该有VerifyResult节点的任何帮助将不胜感激。

我尝试使用绑定文件重命名各种元素,因为我认为该错误与此处记录的问题有关,但事实证明这是无关的。

4

1 回答 1

1

原来“故障”响应不正确。它缺少<soapEnv:Fault>元素。

以下响应现在返回正确的“异常”。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>SOAP Fault Recieved from server.</faultstring>
         <detail>
            <NS1:verify_fault xmlns:NS1="https://www.acme.com">
               <Code>RecordNotFound</Code>
               <Message>No Records Found.</Message>
            </NS1:verifyCustomer_fault>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
于 2013-08-15T10:28:41.413 回答