【发布时间】:2017-09-28 12:44:39
【问题描述】:
我们有一个当前在 WAS8 上运行的应用程序。现在我们将此应用程序迁移到 Liberty。目前,我们遇到的问题是此应用程序的 SOAP 响应的内容类型为 multipart/related。看起来像这样:
HTTP/1.1 200 OK
X-Powered-By: Servlet/3.1
Content-Type: multipart/related; type="application/soap+xml"; boundary="uuid:acacdbe0-a9a8-46cc-aedf-58570a630ff7"; start="<root.message@cxf.apache.org>"; start-info="application/soap+xml"
Content-Language: en-DE
Content-Length: 670
Date: Thu, 28 Sep 2017 12:00:16 GMT
--uuid:acacdbe0-a9a8-46cc-aedf-58570a630ff7
Content-Type: text/xml; charset=UTF-8; type="application/soap+xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
<soap:Envelope>....</soap:Envelope>
--uuid:acacdbe0-a9a8-46cc-aedf-58570a630ff7--
这对我们不利,因为其他客户端可能会遇到解析问题。
使用 WAS8,响应的内容类型为 application/soap+xml;charset=UTF-8;action="mySoapResponse",而没有 uuid 和其他内容。
Here 我发现了与我的问题类似的东西,但不完全是。我们也定义了SOAPBinding,但作为我的@WebService 的注释看起来像这样:
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) 或 @BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
为了使应用程序在 Liberty 上运行,我们必须将部署描述符 (web.xml) 从版本 2.4 更新到 3.0。我猜这也改变了应用程序的行为。
主要原因真的是因为SOAPBinding 注释还是其他原因?
更新: 以下是 WAS8 应用服务器的响应以供比较:
HTTP/1.1 200 OK
Date: Wed, 04 Oct 2017 06:24:22 GMT
Cache-Control: private
Cache-Control: max-age=10
X-Frame-Options: SAMEORIGIN
X-Powered-By: Servlet/3.0
Content-Length: 403
Keep-Alive: timeout=20
Connection: Keep-Alive
Content-Type: application/soap+xml; charset=UTF-8; action="mySoapResponse"
Content-Language: en-US
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope ...>...</soapenv:Envelope>
更新 2:
我注意到 Liberty SOAP 响应还获得了一个不在 WAS8 响应中的 <env:header>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<env:Header xmlns:env="http://www.w3.org/2003/05/soap-envelope"/>
<soap:Body>...
所以背景中似乎发生了一些事情。我查看了 WSDL,但没有定义 header,也没有定义一些 multipart。 如何追溯这些步骤并查看此设置是在哪里对我的响应进行的?
【问题讨论】:
标签: web-services jakarta-ee soap websphere websphere-liberty