【问题标题】:Websphere webservice JAX-WS not responding with MTOM responseWebsphere webservice JAX-WS 没有响应 MTOM 响应
【发布时间】:2016-11-07 16:44:10
【问题描述】:

我正在使用 IBM websphere 8.0,并在服务器上部署了一个 web 服务,并使用注释 @MTOM(enabled=true,threshold=0) 启用了 MTOM。我可以看到 MTOM 用于发送附件,但 web 服务在响应中发送附件时不使用 MTOM。 Web 服务客户端也启用了 MTOM。我尝试使用普通的 java jax-ws 客户端以及 SoapUI。以下是来自服务器的示例响应。附件始终是内联的。

HTTP/1.1 200 OK X-Powered-By: Servlet/3.0 Content-Type: text/xml; charset=UTF-8 Content-Language: en-US Transfer-Encoding: chunked Date: Tue, 05 Jul 2016 18:17:12 GMT <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns3:processRequestResponse > <ns5:Response> <ns5:MessageHeader> <ns5:MessageType>RECEIPT.DOWNLOAD</ns5:MessageType> <ns5:MessageVersion>1</ns5:MessageVersion> <ns5:MessageID>1</ns5:MessageID> <ns5:DateTimeStamp>2016-07-05T12:17:12</ns5:DateTimeStamp> </ns5:MessageHeader> <ns5:ReplyHeader> <ns5:ReplyStatusCode>0</ns5:ReplyStatusCode> <ns5:ReplyStatusValue>SUCCESS</ns5:ReplyStatusValue> </ns5:ReplyHeader> <ns5:Payload> <ns6:DownloadAttachmentResponse/> </ns5:Payload> <ns5:receiptImages>/9j/4AAQSkZJRgABAgAAAQABAAD</ns5:receiptImages> <ns5:receiptImages>/9j/4AAQSkZJRgABAgAAAQABAAD</ns5:receiptImages> </ns5:Response> </ns3:processRequestResponse> </soapenv:Body> </soapenv:Envelope>

这就是我的响应对象的样子

`@XmlRootElement(name =         "Response",namespace="http://response.inboundgateway.ws.axol.cps.application.usbank.com/")
@XmlSeeAlso(DownloadAttachmentResponse.class)
public class Response {

    @XmlElement(name = "MessageHeader", required = true)
    protected Response.MessageHeader messageHeader;
    @XmlElement(name = "ReplyHeader", required = true)
    protected ReplyHeaderType replyHeader;
    @XmlElement(name = "Payload", required = true)
    protected Response.Payload payload;
    @XmlMimeType("image/jpeg")
    protected List<Image> receiptImages;`

【问题讨论】:

  • 你没有在 webservices.xml 中禁用它吗?
  • 你成功了。是的,我发现它被禁用了。谢谢你的帮助。我希望这篇文章将来可以帮助其他人
  • 太棒了!作为答案重新发布。

标签: websphere attachment mtom


【解决方案1】:

确保您没有在 webservices.xml 中禁用 MTOM,这将覆盖基于注释的配置。

来自文档here

对于 JAX-WS Web 服务,使用 webservices.xml 部署描述符是可选的,因为您可以使用注释来指定部署描述符文件中包含的所有信息。您可以使用部署描述符文件来扩充或覆盖现有的 JAX-WS 注释。 您在 webservices.xml 部署描述符中定义的任何信息都会覆盖注释指定的任何相应信息。

【讨论】:

    猜你喜欢
    • 2021-08-31
    • 1970-01-01
    • 2021-05-26
    • 2012-02-09
    • 2019-04-25
    • 1970-01-01
    • 2011-02-18
    • 2012-10-05
    • 1970-01-01
    相关资源
    最近更新 更多