axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ian_d_stew...@bankone.com
Subject RE: From Handler to Service
Date Fri, 11 Jul 2003 16:42:09 GMT


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)" <chenl@research.ge.com> on 07/11/2003 11:33:25
AM

Please respond to axis-user@ws.apache.org

To:   "'axis-user@ws.apache.org'" <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)" <chenl@research.ge.com> 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.


Mime
View raw message