Websphere Liberty的SOAP请求/响应命名空间问题

问题描述

作为应用程序隔离的一部分,我们将应用程序服务器从WebSphere Application Server(WAS)降级到WebSphere Liberty。我们在使用WebSphere Liberty的SOAP请求与响应中面临目标名称间的问题。我们能够生成具有正确格式的WSDL。但是,在通过企业服务总线(ESB)集成服务时,我们最终遇到了请求和响应问题。

从技术上讲,我们正在尝试使用WebSphere liberty中内置的apache-CXF for SOAP,但是作为其他模块需求的一部分,我们的应用程序中还存在axis&axis2 jars。 Axis2带有以下罐子系列。

  • axis2-Metadata-1.6.2.jar
  • axis2-saaj-1.6.2.jar
  • axis2-transport-http-1.6.2.jar
  • axis2-kernel-1.6.2.jar
  • axis2-jaxws-1.6.2.jar

如果您看下面的两个查找,则第一个请求名称空间是正确的,这就是我们所期望的,第二个是我们接收到错误的目标名称空间。请查看标记代码的差异。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://service.api.service.com/2.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:findByCode>
         <code>?</code>
      </ns:findByCode>
   </soapenv:Body></soapenv:Envelope>
   
   
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" "xmlns:ns"=http://service.api.service.com/2.0>
   <soapenv:Header/>
   <soapenv:Body>
      <ns:findByCode>
         <code>?</code>
      </ns:findByCode>
   </soapenv:Body></soapenv:Envelope>

注意:在使用SOAP-UI时,我们正在获取正确的请求信息。仅罐子或自由有一些问题。我们甚至向自由团队提出了要求。如果有人可能已经在Liberty服务器上遇到过类似的问题,我就想从这个社区中汲取想法。

解决方法

作为分析的一部分,我们发现jar axis2-transport-http-1.6.2.jar 是通过使用内部格式化程序引起此问题的。一旦我们将这个jar和下面的jar一起删除,我们将按照问题中提到的预期格式接收请求和响应。

  • axis2-metadata-1.6.2.jar
  • axis2-saaj-1.6.2.jar
  • axis2-kernel-1.6.2.jar

注意:我们找不到上述3个罐子的用法。