Return-Path: Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 34860 invoked by uid 500); 11 Jul 2003 16:42:15 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 34845 invoked from network); 11 Jul 2003 16:42:15 -0000 Subject: RE: From Handler to Service To: axis-user@ws.apache.org X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 Message-ID: From: ian_d_stewart@bankone.com Date: Fri, 11 Jul 2003 12:42:09 -0400 X-MIMETrack: Serialize by Router on CMHSMTP11/SMTP/SVR/ONE(Release 5.0.8 |June 18, 2001) at 07/11/2003 12:42:14 PM MIME-Version: 1.0 Content-type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Not really an answer to your question, but have you thought of implementing your policy enforcement as a seperate handler within the request flow? This should get around the bug in MessageContext.getCurrentContext() and would allow your service to concentrate on business logic, seperate from policy enforcement. Ian Ian D. Stewart Open Systems Engineer II Enterprise Midrange - Bank One Infrastructure & Operations ian_d_stewart@bankone.com (614) 213-6100 "Chen, Li (Research, YOH)" on 07/11/2003 11:33:25 AM Please respond to axis-user@ws.apache.org To: "'axis-user@ws.apache.org'" cc: Subject: RE: From Handler to Service Hi Ian, Thanks for the help. However, I have already tried the method below...the problem is, (and I'm on Win2k) whenever I try to say: MessageContext context= MessageContext.getCurrentContext(); on the service side, I keep getting this InvocationTargetException error. (Once I remove the previous line of code, everything works). What I'm trying to do is retreive the name of the application so the service side logic can apply policies to data access... on the client side, we have something like call.setUsername("My Application Name"); All what I'm trying to do on the _service_ side is (the authentication handler works fine, by the way -- it can get Message Context without any problems): String appName= context.getUsername(); //do some processing with policy applied to appName application. Is this a Windows 2k specific error? I'm on JBoss 3.2.1 with Tomcat and Axis 1.1 Final. Thanks! Lee -----Original Message----- From: ian_d_stewart@bankone.com [mailto:ian_d_stewart@bankone.com] Sent: Friday, July 11, 2003 11:12 AM To: axis-user@ws.apache.org Subject: Re: From Handler to Service You can store any arbitrary data in the MessageContext, via getProperty ()/setProperty(). You can then access this information from within your service by calling MessageContext.getCurrentContext(). Example: Handler.invoke(MessageContext context) { context.setProperty("org", "research.ge.com"); } Service.doSomething() { MessageContext context = MessageContext.getCurrentContext(); String org = (String)context.getProperty("org"); } HTH, Ian Ian D. Stewart Open Systems Engineer II Enterprise Midrange - Bank One Infrastructure & Operations ian_d_stewart@bankone.com (614) 213-6100 "Chen, Li (Research, YOH)" on 07/11/2003 10:59:14 AM Please respond to axis-user@ws.apache.org To: axis-user@ws.apache.org cc: Subject: From Handler to Service Hi all, Is there any way to pass information (say, a String value) from a handler to a service? The service is "registered" in the deploy.wsdd file. Thanks. g GE Global Research ____________________________________________________________________________ ______________________________________________ Li (Lee) Ye Chen Intern - Information Technology Management Services One Research Circle, KWC-255D Niskayuna, NY 12309 (518) 387-4556 This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you.