Thanks Daniel. Perfect. In PAYLOAD mode, and Source, the attachments are not saved on the proxy server and are streamed to the end service. What am i loosing/gaining by using Payload mode compared to Message mode?
Thanks, Sam On Mon, Apr 1, 2013 at 9:56 AM, Daniel Kulp [via CXF] < [email protected]> wrote: > > On Mar 29, 2013, at 3:16 PM, sam.tech <[hidden > email]<http://user/SendEmail.jtp?type=node&node=5725641&i=0>> > 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 > [hidden email] <http://user/SendEmail.jtp?type=node&node=5725641&i=1> - > http://dankulp.com/blog > > Talend Community Coder - http://coders.talend.com > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://cxf.547215.n5.nabble.com/Provider-with-MTOM-Stream-tp5725571p5725641.html > To unsubscribe from Provider with MTOM Stream, click > here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5725571&code=dGVjaGFjY3QxMjNAZ21haWwuY29tfDU3MjU1NzF8LTE4MzI4NzMyNg==> > . > NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://cxf.547215.n5.nabble.com/Provider-with-MTOM-Stream-tp5725571p5725697.html Sent from the cxf-user mailing list archive at Nabble.com.
