On Thursday, February 23, 2012 1:30:48 PM mkhand02 wrote:
> Breaking out a reply on another post into a new thread; I need to inject
> attachment(s) into a server response (I can read them just fine from the
> client).  The setAttachments() method doesn't work, but I am guessing
> because its setting the attachments on [moot] the incoming request.  I am
> NOT able to access the outgoing message, or any Resource or Context
> annotations.  Need to use the PhaseInterceptor for the current message... so
> I don't know if that's related to my issue.
> 
> Thanks much in advance, I've learned a ton of things from this support
> forum.


With pure jaxws, if you get the WebServiceContext injected, you can do 
something like:

ctx.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, mapOfAttach)

or similar.     If not using pure jaxws, definitely more complex as the 
response message would likely be null.   You would likely need to store 
something on the exchange and then configure in an interceptor that would copy 
that into the response during the response chain.  It may be best to just 
"fake" the jaxws by doing:


WebServiceContext context = new 
org.apache.cxf.jaxws.context.WebServiceContextImpl();

and just using that.


Dan







> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/SOAP-Attachment-using-jaxws-tp5509563p55095
> 63.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