Hi Gabo

On Tue, Oct 12, 2010 at 11:01 AM, Gabo Manuel <[email protected]>wrote:

>  Hi All,
>
> I am already able to retrieve the endpoint using the following:
>
> Exchange exchange = ...;// retrieved from message
> exchange.getEndpoint().getEndpointInfo().getName()
>
> I was wondering if it is possible to retrieve the actual service method
> invoked. Am doing all this at a registered out interceptor at
> Phase.MARSHAL_ENDING.
>
> A code like this one should give you the name, will work for JAXWS & JAXRS
:

OperationInfo opInfo = ex.get(OperationInfo.class);
String operationName = opInfo == null ? null :
opInfo.getName().getLocalPart();

if (operationName == null) {
       Object nameProperty = ex.get("org.apache.cxf.resource.operation.name
");
       if (nameProperty !=  null) {
           operationName = nameProperty.toString();
       }
}

cheers, Sergey


> Thanks in advance.
>
> Gabo
>

Reply via email to