Description
Problem:
Setting the system property "org.apache.cxf.io.CachedOutputStream.Threshold" to raise the threshold size of writing a temporary file to disk, does not affect AttachmentDeserializer.
AttachmentDeserializer will call AttachmentUtil.setStreamedAttachmentProperties(Message, CachedOutputStream), effectively setting the temp-file threshold to AttachmentDeserializer.THRESHOLD (100k).
Solution:
AttachmentDeserializer should read the system property and set its value to the message context with the key AttachmentDeserializer.ATTACHMENT_MEMORY_THRESHOLD, before calling AttachmentUtil.setStreamedAttachmentProperties(...).
Workaround:
Register a custom interceptor, which will write the above mentioned system property to the message context. The interceptor must be registered to a Phase that will be called before JAXBAttachmentSchemaValidationHack is called.