jofroe
jofroe

Reputation: 431

JAX-WS CXF empty XOP multipart attachments with file size > ~210kb

I am using jax-ws cxf to load documents from a SOAP interface. I can get the correct document via SoapUI (xop/multipart). Unfortunately, when I try to load the attachment via code, the CachedOutputStream is empty for files greater than ~210kb.

What I tried:

When debugging:

PhaseInterceptorChain#doIntercept uses the AttachmentInInterceptor (at currentInterceptor.handleMessage(message);) which loads the attachments with LazyAttachmentCollection and adds it to the message.

  1. happy case: document is loaded into CachedOutputStream and available after the for-loop.

  2. error case (file too big?): document is available directly after currentInterceptor.handleMessage is called, but disappears when the loop has finished

    In both of the above cases however, a correct tmp file is saved to my disk (with exactly my document's content). Furthermore, I can load that file in both cases even when the loop has finished with: ((org.apache.cxf.attachment.LazyAttachmentCollection)(message.getAttachments())).loadAll();

Upvotes: 0

Views: 1193

Answers (1)

Łukasz
Łukasz

Reputation: 21

I had similar problem with apache-cxf 3.1.6. The issue was that files above 102kB were empty. After some digging it turned turned out to be "attachment-memory-threshold" which u can set in requestContext, for some reason file cache doesnt seem to work.

Upvotes: 2

Related Questions