问题
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?
来源:https://stackoverflow.com/questions/60023556/how-to-avoid-xop-generation-in-cxf-behaviour-changed-between-3-3-2-and-3-3-4