0

This issue involves recent CXF change (3.3.2->3.3.4).

We are sending a SOAP request to our partner with image contents On TomEE 8.0.0 (CXF 3.3.2), the SOAP request generated doesn't include XOP generation :

<ns3:Picture>
<ns6:Image>
<ns6:StorageFormat>JPG</ns6:StorageFormat>
<ns6:Length>13286</ns6:Length>
<ns6:Buffer>/9j/4AAQSkZJRgABAAEAlgCWAAD//gAfTE (...) VBRCB=</ns6:Buffer>
</ns6:Image>
</ns3:Picture>
<ns3:Signature>
<ns6:Image>
<ns6:StorageFormat>TIF</ns6:StorageFormat>
<ns6:Length>700</ns6:Length>
<ns6:Buffer>SUkqAAgAAAATAP4ABAABAAAAAgAAAAABBAABAA (...) AA+==</ns6:Buffer>
</ns6:Image>
</ns3:Signature>

Running the code, isMTOMEnabled() return false

SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
boolean mtomEnabled = binding.isMTOMEnabled();

Same war deployed on TomEE 8.0.1 (CXF 3.3.4). Now CXF generates (unrequested) XOP

<ns3:Picture>
<ns6:Image>
<ns6:StorageFormat>JPG</ns6:StorageFormat>
<ns6:Length>12099</ns6:Length>
<ns6:Buffer>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:61bc1e4b-5e7c-47ea-ae1e-fc0ce1edbdd5-1@www.astra.admin.ch"/>
</ns6:Buffer>
</ns6:Image>
</ns3:Picture>
<ns3:Signature>
<ns6:Image>
<ns6:StorageFormat>TIF</ns6:StorageFormat>
<ns6:Length>580</ns6:Length>
<ns6:Buffer>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:61bc1e4b-5e7c-47ea-ae1e-fc0ce1edbdd5-2@www.astra.admin.ch"/>
</ns6:Buffer>
</ns6:Image>
</ns3:Signature>

As our partner is not able to parse xop, how can avoid xop SOAP inclusion and get same result as previously with CXF 3.3.2?

skay
  • 1,681
  • 1
  • 14
  • 13
  • Here is the solution : https://stackoverflow.com/questions/46038257/set-expand-xop-include-for-wss4joutinterceptor-in-apache-cxf-3-0-x – skay Feb 05 '20 at 12:44
  • PersonPortType portType = ((PersonService) getService()).getPersonHttpSoap11Port(new javax.xml.ws.soap.MTOMFeature(false, Integer.MAX_VALUE)); – skay Feb 05 '20 at 12:45

0 Answers0