Springws和MTOM客户端KO通过平衡器时

问题描述 投票:0回答:1

我的客户端将启用MTOM的pdf二进制文档发送给soapservice时遇到问题。该服务已正确公开并提供。当我调用公开该服务的服务器的端点时,一切正常,当我通过“服务网关”调用同一服务时,它在收到所有请求后会发回“错误请求”。

>Accept-Encoding: gzip
>Content-Type: multipart/related;type="application/xop+xml";start-info="text/xml"
>Content-Disposition: attachment
>Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>SOAPAction: "http://ws.documents...."
>Content-Type: Multipart/Related; boundary="----=_Part_1_1067527082.1584978884916"; >type="application/xop+xml"; start-info="text/xml"
>Cache-Control: no-cache
>Pragma: no-cache
>User-Agent: Java/1.8.0_222
>Host: service.xx.yy:8080
>Connection: keep-alive
>Content-Length: 105614


....
> This is the trace of the service gateway:
> v^[¹‹‘HTTP/1.1 400 [ISC.0064.9101] Bad Request Connection: close
> Content-Length: 0

同一服务网关是不带mtom的所有其他服务的直通,一切正常。奇怪的是,当我通过服务网关启用了具有附件和MTOM的soapui呼叫时,呼叫正确结束。这是代码的核心:

response = (JAXBElement<CreateDocumentsResponseType>) wst.marshalSendAndReceive(uri,request);
  1. 其中wst是启用了MTOM的普通WebServiceTemplate实例
  2. request是已与数据处理程序一起打包的文档封送的信封。

在发送消息之前,我做了一个拦截器,以使用自定义身份验证设置请求标头。

mtom webservicetemplate
1个回答
0
投票

平衡器进行了“预检”,表明webservicetemplate无法正确处理。创建了自定义拦截器来处理此问题。

© www.soinside.com 2019 - 2024. All rights reserved.