You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Chris Hardin <ch...@gmail.com> on 2010/06/02 20:03:35 UTC

Getting the name of the current executed operation

Does anyone know how to get the name of the current executing operation??
When I execute client code, this is populated, but when someone calls my
service my interceptor doesn't have the name of the requested operation.


if (message.getExchange().get( Message.WSDL_OPERATION ) != null){
              log.debug("Operation: " + message.getExchange().get(
Message.WSDL_OPERATION ).toString());
               operation = message.getExchange().get( Message.WSDL_OPERATION
).toString();
            }

Re: Getting the name of the current executed operation

Posted by Glen Mazza <gl...@gmail.com>.
If you're using Doc/Lit/Wrapped, it will be the element name of the immediate
child of the soap:body, you might also be able to read the soapAction HTTP
header if it is being populated by the client.

Glen


Chris Hardin wrote:
> 
> Does anyone know how to get the name of the current executing operation??
> When I execute client code, this is populated, but when someone calls my
> service my interceptor doesn't have the name of the requested operation.
> 
> 
> if (message.getExchange().get( Message.WSDL_OPERATION ) != null){
>               log.debug("Operation: " + message.getExchange().get(
> Message.WSDL_OPERATION ).toString());
>                operation = message.getExchange().get(
> Message.WSDL_OPERATION
> ).toString();
>             }
> 
> 

-- 
View this message in context: http://old.nabble.com/Getting-the-name-of-the-current-executed-operation-tp28758008p28758222.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Getting the name of the current executed operation

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 03 June 2010 9:18:10 am Chris Hardin wrote:
> I tried it. I get back the Binding Operation Info. Which method contains
> the name of the operation. There is a lot of information on that class.

I think it's just getName().  That returns the QName. 

Dan


> 
> On Wed, Jun 2, 2010 at 1:34 PM, Daniel Kulp <dk...@apache.org> wrote:
> > On Wednesday 02 June 2010 2:03:35 pm Chris Hardin wrote:
> > > Does anyone know how to get the name of the current executing
> > > operation?? When I execute client code, this is populated, but when
> > > someone calls my service my interceptor doesn't have the name of the
> > > requested operation.
> > > 
> > > 
> > > if (message.getExchange().get( Message.WSDL_OPERATION ) != null){
> > > 
> > >               log.debug("Operation: " + message.getExchange().get(
> > > 
> > > Message.WSDL_OPERATION ).toString());
> > > 
> > >                operation = message.getExchange().get(
> > > 
> > > Message.WSDL_OPERATION ).toString();
> > > 
> > >             }
> > 
> > On the server side, it would also depend on what phase your interceptor
> > runs
> > in.   It would have to be after the read phase where we would be
> > determining
> > the operation that was called.   You may also want to try:
> > message.getExchange().get(BindingOperationInfo.class)
> > and getting the name from that.   I'd like to deprecate WSDL_OPERATION as
> > it
> > does cost a little bit to calc/set when 99% of the time it isn't used and
> > when
> > required, can be produced from the BindingOperationInfo.
> > 
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Getting the name of the current executed operation

Posted by Chris Hardin <ch...@gmail.com>.
I tried it. I get back the Binding Operation Info. Which method contains the
name of the operation. There is a lot of information on that class.

On Wed, Jun 2, 2010 at 1:34 PM, Daniel Kulp <dk...@apache.org> wrote:

> On Wednesday 02 June 2010 2:03:35 pm Chris Hardin wrote:
> > Does anyone know how to get the name of the current executing operation??
> > When I execute client code, this is populated, but when someone calls my
> > service my interceptor doesn't have the name of the requested operation.
> >
> >
> > if (message.getExchange().get( Message.WSDL_OPERATION ) != null){
> >               log.debug("Operation: " + message.getExchange().get(
> > Message.WSDL_OPERATION ).toString());
> >                operation = message.getExchange().get(
> > Message.WSDL_OPERATION ).toString();
> >             }
>
> On the server side, it would also depend on what phase your interceptor
> runs
> in.   It would have to be after the read phase where we would be
> determining
> the operation that was called.   You may also want to try:
> message.getExchange().get(BindingOperationInfo.class)
> and getting the name from that.   I'd like to deprecate WSDL_OPERATION as
> it
> does cost a little bit to calc/set when 99% of the time it isn't used and
> when
> required, can be produced from the BindingOperationInfo.
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Re: Getting the name of the current executed operation

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday 02 June 2010 2:03:35 pm Chris Hardin wrote:
> Does anyone know how to get the name of the current executing operation??
> When I execute client code, this is populated, but when someone calls my
> service my interceptor doesn't have the name of the requested operation.
> 
> 
> if (message.getExchange().get( Message.WSDL_OPERATION ) != null){
>               log.debug("Operation: " + message.getExchange().get(
> Message.WSDL_OPERATION ).toString());
>                operation = message.getExchange().get(
> Message.WSDL_OPERATION ).toString();
>             }

On the server side, it would also depend on what phase your interceptor runs 
in.   It would have to be after the read phase where we would be determining 
the operation that was called.   You may also want to try:
message.getExchange().get(BindingOperationInfo.class)
and getting the name from that.   I'd like to deprecate WSDL_OPERATION as it 
does cost a little bit to calc/set when 99% of the time it isn't used and when 
required, can be produced from the BindingOperationInfo.   


-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog