So it seems that we did some duplicate work in the code. In 
org.apache.cxf.transport.ChainInitiationObserver we already set most properties 
into the Exchange except the operation name, the operation name wont be 
available until the interceptor who knows how to parse the operation name info 
from the incoming message payload. In RPCInInterceptor/DocLitInInterceptor we 
set these properties again, which is duplicate.  
RPCInInterceptor/DocLitInInterceptor only need to set operation name.

Cheers,
Jervis



> -----Original Message-----
> From: Daniel Kulp [mailto:[EMAIL PROTECTED]
> Sent: 2007?9?1? 0:09
> To: [email protected]
> Cc: Liu, Jervis
> Subject: Re: Obtaining source address and operation name
> 
> 
> 
> Jervis,
> 
> Those properties are on the message, not the exchange.   I 
> just checked 
> both the DocLitInInterceptor and RPCInInterceptor and they 
> put them on 
> the message.
> 
> That said, I just added the code to the RPCInInterceptor earlier this 
> week.   If the service is RPC, that information won't be there unless 
> you are using a SNAPSHOT version.  (even then, I'm not sure.  I don't 
> remember when I did the last snapshot)
> 
> Dan
>  
> 
> 
> On Thursday 30 August 2007, Liu, Jervis wrote:
> > these properties are stored in Exchange, not in Message. following
> > should work for you:
> >
> > Object operation = message.getExchange().get( Message.WSDL_OPERATION
> > ); Object port = message.getExchange().get( Message.WSDL_PORT );
> > Object service = message.getExchange().get( Message.WSDL_SERVICE );
> > Object context = message.getExchange().get( 
> Message.INVOCATION_CONTEXT
> > ); Object endpointAddress = message.getExchange().get(
> > Message.ENDPOINT_ADDRESS );
> >
> > Their types are defined in JAX-WS spec, section 9.4.1.
> >
> > .description URI
> > .service QName
> > .port QName
> > .interface QName
> > .operation QName
> >
> > Jervis
> >
> > > -----Original Message-----
> > > From: James Royalty [mailto:[EMAIL PROTECTED]
> > > Sent: 2007?8?31? 10:07
> > > To: [email protected]
> > > Subject: Re: Obtaining source address and operation name
> > >
> > >
> > > Hi Jervis,
> > >
> > > As I test, I was doing:
> > >
> > > Object operation = message.get( Message.WSDL_OPERATION );
> > > Object port = message.get( Message.WSDL_PORT );
> > > Object service = message.get( Message.WSDL_SERVICE );
> > > Object context = message.get( Message.INVOCATION_CONTEXT );
> > > Object endpointAddress = message.get( Message.ENDPOINT_ADDRESS );
> > >
> > > ... as I didn't know what type would be returned.  All ended up
> > > being null.  The services are using a servlet transport, btw.
> > >
> > > Thanks!
> > > --
> > > James
> > >
> > > Liu, Jervis wrote:
> > > > Hi What code did you use to retrieve WSDL_OPERATION, WSDL_PORT
> > > > etc?
> > > >
> > > > Thanks,
> > > > Jervis
> > > >
> > > >> -----Original Message-----
> > > >> From: James Royalty [mailto:[EMAIL PROTECTED]
> > > >> Sent: 2007?8?31? 8:28
> > > >> To: [email protected]
> > > >> Subject: Obtaining source address and operation name
> > > >>
> > > >>
> > > >> Hi,
> > > >>
> > > >> I'm trying to write an "in" interceptor, using
> > > >> org.apache.cxf.interceptor.LoggingInInterceptor as a
> > >
> > > starting point.
> > >
> > > >> I'm trying to log
> > > >>
> > > >> - the source (IP) address that originate the (SOAP) Message;
> > > >> - the SOAP operation that was invoked.
> > > >>
> > > >> Any hints on how I can obtain either of these?
> > > >>
> > > >> I've tried adding the interceptor at various phases (RECEIVE,
> > > >> PRE_INVOKE, INVOKE) and getting several values from 
> the Messsage:
> > > >> WSDL_OPERATION, WSDL_PORT, WSDL_SERVICE, INVOCATION_CONTEXT,
> > > >> ENDPOINT_ADDRESS.  All these end up being null.
> > > >>
> > > >> Thanks!
> > > >
> > > > ----------------------------
> > > > IONA Technologies PLC (registered in Ireland)
> > > > Registered Number: 171387
> > > > Registered Address: The IONA Building, Shelbourne Road,
> > >
> > > Dublin 4, Ireland
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, Dublin 4,
> > Ireland
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to