Jerry,
the class org.apache.cxf.message.MessageUtils provides some helper methods to figure out other context information besides whether I'm the requestor. Thanks Oli ________________________________ Von: Gerald Preissler [[email protected]] Gesendet: Dienstag, 4. Oktober 2011 13:05 Bis: [email protected] Betreff: Re: Interceptor implementation - how to find current location Willem, thanks for the hint - I've got it integrated and it works like described. Regards Jerry On 09/30/2011 12:20 PM, Willem Jiang wrote: You can use below code to tell if the messsage is from client. Boolean.TRUE.equals(message.get(Message.REQUESTOR_ROLE)) On Fri Sep 30 17:40:10 2011, Gerald Preissler wrote: I'm implementing an interceptor for CXF and am looking for a way to programmatically determine where the interceptor is actually being called during processing, i.e. I want to know whether the interceptor is being run on the client or the service side and in the outgoing or incoming interceptor chain. Outgoing or incoming chain is easy: message.get(MESSAGE_INFO_KEY).getType() returns Type.INPUT or Type.OUTPUT To determine if I am on the client or service side I came up with something like this (pseudocode): ((type == Type.INPUT)&& (message == message.getExchange().getOutMessage())) => Client / Request ((type == Type.INPUT)&& (message == message.getExchange().getInMessage())) => Provider / Request ((type == Type.OUTPUT)&& (message == message.getExchange().getOutMessage())) => Provider / Response ((type == Type.OUTPUT)&& (message == message.getExchange().getInMessage())) => Client / Response Did I get this right? Is there maybe a more elegant way to handle this? Thanks in advance for any hints. Best regards Jerry -- Senior Consultant Tel.: +49 228 763 776 11 Mob.: + 49 175 26 25 667 Fax: +49 228 763 776 99 [email protected]<mailto:[email protected]> SOPERA - The Application Integration Division of Talend. SOPERA – Open Source SOA Subscription Services, Support & Maintenance, Training, Technical SOA Consulting & Customized Development www.sopera.com<http://www.sopera.com/> SOPERA GmbH · Geschäftsführer: Dr. Ricco Deutscher, Harald Weimer Hohenlindner Str.11b · 85622 München · Servatiusstr. 53 · 53113 Bonn · Handelsregister: Bonn HRB 15336 Vertraulichkeitshinweis: Diese Nachricht und jeder übermittelte Anhang beinhaltet vertrauliche Informationen und ist nur für die Personen oder das Unternehmen bestimmt, an welche sie tatsächlich gerichtet ist. Sollten Sie nicht der Bestimmungsempfänger sein, weisen wir Sie darauf hin, dass die Verbreitung, das (auch teilweise) Kopieren sowie der Gebrauch der empfangenen E-Mail und der darin enthaltenen Informationen gesetzlich verboten ist und gegebenenfalls Schadensersatzpflichten auslösen kann. Sollten Sie diese Nachricht aufgrund eines Übermittlungsfehlers erhalten haben, bitten wir Sie, den Sender unverzüglich hiervon in Kenntnis zu setzen
