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



我遇到一个客户端问题,该客户端将启用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是与已经用数据处理程序打包的文档一起整理的信封

在发送消息之前,我制作了一个拦截器来设置带有自定义身份验证的请求标头。

平衡器做出了一个Web服务模板没有正确处理的"preflight"。创建了自定义拦截器来处理此问题。