title: Springws and MTOM client KO when pass through a balancer
body: <p>I have a problem with a client that sends a pdf binary document with MTOM enabled to a soapservice. The service is correctly exposed and served. When i call the endpoint of the server that expose the service all goes ok, when i call the same service through a "service gateway" it sends back a "bad request" after it  receive all the request. </p>
  
  <pre><code>&gt;Accept-Encoding: gzip
  &gt;Content-Type: multipart/related;type="application/xop+xml";start-info="text/xml"
  &gt;Content-Disposition: attachment
  &gt;Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
  &gt;SOAPAction: "http://ws.documents...."
  &gt;Content-Type: Multipart/Related; boundary="----=_Part_1_1067527082.1584978884916"; &gt;type="application/xop+xml"; start-info="text/xml"
  &gt;Cache-Control: no-cache
  &gt;Pragma: no-cache
  &gt;User-Agent: Java/1.8.0_222
  &gt;Host: service.xx.yy:8080
  &gt;Connection: keep-alive
  &gt;Content-Length: 105614
  
  
  ....
  &gt; This is the trace of the service gateway:
  &gt; v^[¹‹‘HTTP/1.1 400 [ISC.0064.9101] Bad Request Connection: close
  &gt; Content-Length: 0
  </code></pre>
  
  <p>The same service gateway is a passthrough of all other services without mtom and all goes ok.
  The weird thing is that when i call with soapui with attachment and MTOM enabled through the service gateway the call ends correctly.
  This is the core of the code:</p>
  
  <pre><code>response = (JAXBElement&lt;CreateDocumentsResponseType&gt;) wst.marshalSendAndReceive(uri,request);
  </code></pre>
  
  <ol>
  <li>Where <em>wst</em> is a normal WebServiceTemplate instance with MTOM enabled</li>
  <li><em>request</em> is the envelope marshalled with the document already packed with datahandler.</li>
  </ol>
  
  <p>Before send the message, i made an interceptor to set the request header with custom authentication.</p>