You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Colm O hEigeartaigh <co...@progress.com> on 2008/10/22 18:39:23 UTC
CXF WebServiceContext question
Hi guys,
I have access to a javax.xml.ws.WebServiceContext object in an endpoint
implementation. I have an "out" interceptor that does some processing on
the outbound message. I need to pass some information through to the
interceptor somehow from the endpoint implementation. At the moment I'm
just getting a reference to the interceptor using:
org.apache.cxf.Bus.getOutInterceptors()
and setting some information directly on it, after the appropriate
casting.
Instead I want to set some information possibly using
WebServiceContext.getMessageContext().put(...). How can I get access to
this via org.apache.cxf.message.Message in the interceptor, or what's
the best way to do this?
Thanks,
Colm.
Re: CXF WebServiceContext question
Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
Colm O hEigeartaigh wrote:
> Instead I want to set some information possibly using
> WebServiceContext.getMessageContext().put(...). How can I get access to
> this via org.apache.cxf.message.Message in the interceptor, or what's
> the best way to do this?
I *think* you can just call get() on the Message with the same key you
put() into the WSC message context.
Ian
--
Ian Roberts | Department of Computer Science
i.roberts@dcs.shef.ac.uk | University of Sheffield, UK
RE: CXF WebServiceContext question
Posted by Colm O hEigeartaigh <co...@progress.com>.
Thanks guys, I can confirm that
WebServiceContext.getMessageContext().put(...)
can be retrieved in the out interceptor with
Message.getExchange().getInMessage().get(...)
Colm.
-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: 22 October 2008 18:08
To: users@cxf.apache.org
Cc: Colm O hEigeartaigh
Subject: Re: CXF WebServiceContext question
Anything you "put" on the WebServiceContext should be retrievable
directly as
it in an out interceptor, although it's probably set on the "in"
message.
Thus, message.getExchange().getInMessage().get("myKey");
Dan
On Wednesday 22 October 2008 12:39:23 pm Colm O hEigeartaigh wrote:
> Hi guys,
>
> I have access to a javax.xml.ws.WebServiceContext object in an
endpoint
> implementation. I have an "out" interceptor that does some processing
on
> the outbound message. I need to pass some information through to the
> interceptor somehow from the endpoint implementation. At the moment
I'm
> just getting a reference to the interceptor using:
>
> org.apache.cxf.Bus.getOutInterceptors()
>
> and setting some information directly on it, after the appropriate
> casting.
>
> Instead I want to set some information possibly using
> WebServiceContext.getMessageContext().put(...). How can I get access
to
> this via org.apache.cxf.message.Message in the interceptor, or what's
> the best way to do this?
>
> Thanks,
>
> Colm.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: CXF WebServiceContext question
Posted by Daniel Kulp <dk...@apache.org>.
Anything you "put" on the WebServiceContext should be retrievable directly as
it in an out interceptor, although it's probably set on the "in" message.
Thus, message.getExchange().getInMessage().get("myKey");
Dan
On Wednesday 22 October 2008 12:39:23 pm Colm O hEigeartaigh wrote:
> Hi guys,
>
> I have access to a javax.xml.ws.WebServiceContext object in an endpoint
> implementation. I have an "out" interceptor that does some processing on
> the outbound message. I need to pass some information through to the
> interceptor somehow from the endpoint implementation. At the moment I'm
> just getting a reference to the interceptor using:
>
> org.apache.cxf.Bus.getOutInterceptors()
>
> and setting some information directly on it, after the appropriate
> casting.
>
> Instead I want to set some information possibly using
> WebServiceContext.getMessageContext().put(...). How can I get access to
> this via org.apache.cxf.message.Message in the interceptor, or what's
> the best way to do this?
>
> Thanks,
>
> Colm.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: CXF WebServiceContext question
Posted by Glen Mazza <gl...@gmail.com>.
AFAIK WebServiceContext is the medium used by JAX-WS Handlers to get
information to the SEI implementation, so I would look at the interceptors
which implement JAX-WS handlers for a clue. Or, wait until Dan K or someone
else can answer your question more substantively.
If interceptors can't help you, you may be able to use JAX-WS handlers to
accomplish what you're trying to do otherwise.
HTH,
Glen
Colm O hEigeartaigh wrote:
>
> Hi guys,
>
> I have access to a javax.xml.ws.WebServiceContext object in an endpoint
> implementation. I have an "out" interceptor that does some processing on
> the outbound message. I need to pass some information through to the
> interceptor somehow from the endpoint implementation. At the moment I'm
> just getting a reference to the interceptor using:
>
> org.apache.cxf.Bus.getOutInterceptors()
>
> and setting some information directly on it, after the appropriate
> casting.
>
> Instead I want to set some information possibly using
> WebServiceContext.getMessageContext().put(...). How can I get access to
> this via org.apache.cxf.message.Message in the interceptor, or what's
> the best way to do this?
>
> Thanks,
>
> Colm.
>
>
--
View this message in context: http://www.nabble.com/CXF-WebServiceContext-question-tp20114927p20115281.html
Sent from the cxf-user mailing list archive at Nabble.com.