我有java web服务。我使用apache-cxf生成wsdl。其他开发人员使用生成的wsdl来创建某个特定会计程序的客户端。
当此客户端尝试调用Web方法时,我可以看到解组错误 - soap消息包含意外的命名空间。
org.apache.cxf.interceptor.Falut Unmarshalling Error: unexpected element(uri:"my.namespace.here", local:"documentNumber"). Expected elements are <{}id>,<{documentNumber}>,{here list of other DTO fields}.
我希望获得的请求示例
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<m:publicInnerInvoiceDocument xmlns:m="my.namespace.here">
<arg0>
<documentNumber>String</documentNumber>
</arg0>
</m:publicInnerInvoiceDocument>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
我使用Altova xml间谍工具获取此消息 - 使用wsdl描述创建请求的工具。我的服务很好用。
我从其他客户端获得的消息示例
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<m:publicInnerInvoiceDocument xmlns:m="my.namespace.here">
<arg0 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="">
<m:documentNumber>000001</m:documentNumber>
</arg0>
</m:publicInnerInvoiceDocument>
</soap:Body>
</soap:Envelope>
客户端开发人员说他没有工具来控制请求创建。他使用的平台会自动执行并做错。
我最好的解决方法是使用@HandlerChain处理肥皂并更正我得到的肥皂信息。我甚至不知道是否可能。
我不喜欢它。你还有其他建议吗? 可以因为错误的Web服务描述吗?