我使用 Axis2(1.4) 引擎和 Eclipse 插件实现了一个 Web 服务。客户端需要以下格式的响应:
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3..org/2001/12/soap-encoding" >
<soap:Body>
<GetResponse>
<SearchResult>0</SearchResult>
</GetResponse>
</soap:Body>
</soap:Envelope>
但我的服务返回以下响应
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<GetResponse>
<SearchResult>0</SearchResult>
</GetResponse>
</soapenv:Body>
</soapenv:Envelope>
我是否必须使用较旧的 Axis 版本?或者,有没有办法更改前缀并接受旧的 SOAP 请求?
谢谢。
问候。
最佳答案
Axis2 的旧版本 - Axis1.x,完全不同。 Apache 对 Axis2 所做的,是他们改变了完整的架构。它们包括 Axis2 中处理程序、服务和模块的新概念。
因此,不可能再使用相同的客户端代码接受旧的 (Axis1.4) 和新的 (Axis2) 请求。
关于web-services - Axis2 Web 服务 namespace 前缀转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36429974/