On Mar 29, 2013, at 3:16 PM, sam.tech <[email protected]> wrote:

> One additional piece of info. I am using Message Mode. 

That would likely be the issue.  With the SAAJ model, we have to fill in the 
attachment collection of the SOAPMessage which would cause this caching.

My SUGGESTION (and I'm not 100% sure this would work, please try and report 
back) would be PAYLOAD mode using Source, but you would need to copy the 
attachment collection yourself.   Using pure JAX-WS API's, you could have the 
WebServiceContext injected (via an @Resource) and grab the 
MessageContext.INBOUND_MESSAGE_ATTACHMENTS which would be a Map<String, 
DataHandler> and then set that into the request context of the dispatch object 
you are creating.

HOWEVER, you'd likely be better off dropping out of pure JAX-WS and doing:

Collection<Attachment> attachments = 
PhaseInterceptorChain.getCurrentMessage().get(Message.ATTACHMENTS);

and then setting that onto the Dispay request context using the 
Message.ATTACHMENTS key.  


Dan


> I tried the stream mode and that did not dispatch attachments. 
> 
> @WebServiceProvider(portName = "ProxyProviderPort", serviceName =
> "ProxyProviderService", targetNamespace = "http://sandbox.aaa.com/proxy";)
> @ServiceMode(Mode.MESSAGE)
> @MTOM
> public class MyProxyServiceProvider implements Provider<SOAPMessage> {
>       @Override
>       public SOAPMessage invoke(SOAPMessage request) {
>       
>                  Dispatch<SOAPMessage> disp = service.createDispatch(xxx, 
>                                       SOAPMessage.class, 
> Service.Mode.MESSAGE, 
>                                       new MTOMFeature(4000));
>                       return disp.invoke(request);
>       }
> }
> 
> 
> 
> --
> View this message in context: 
> http://cxf.547215.n5.nabble.com/Provider-with-MTOM-Stream-tp5725571p5725610.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to