Return-Path: Mailing-List: contact axis-user-help@xml.apache.org; run by ezmlm Delivered-To: mailing list axis-user@xml.apache.org Received: (qmail 86960 invoked from network); 9 Apr 2002 02:29:28 -0000 Received: from pimout3-ext.prodigy.net (HELO pimout3-int.prodigy.net) (207.115.63.102) by daedalus.apache.org with SMTP; 9 Apr 2002 02:29:28 -0000 Received: from HOZE (adsl-64-175-247-97.dsl.sntc01.pacbell.net [64.175.247.97]) by pimout3-int.prodigy.net (8.11.0/8.11.0) with ESMTP id g392TaL196640 for ; Mon, 8 Apr 2002 22:29:36 -0400 From: "Hozefa Botee" To: Subject: RE: MessageContext? Date: Mon, 8 Apr 2002 19:29:37 -0700 Message-ID: <000b01c1df6e$65387540$867ba8c0@simonsays.interlacesystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal In-Reply-To: <000901c1df06$9167eeb0$a19068cf@MINIME> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N does that mean I call .setMaintainSession(true) in the service method as well? is that all that is required for a session-based service? H > -----Original Message----- > From: Glen Daniels [mailto:gdaniels@macromedia.com] > Sent: Saturday, April 06, 2002 10:03 AM > To: axis-user@xml.apache.org > Subject: Re: MessageContext? > > > Hi Hozefa: > > I wouldn't rely on the MessageContext being set in the > constructor for your object, although it is interesting that > we apparently make two service objects - I'll look into that > to see what's up there. > > The MessageContext represents information about a PARTICULAR > request/invocation, and thus should be examined only in the > context of an actual service method (doSomething()). Don't > cache it, either, btw! > > If you have a need to know more about the local Axis > configuration around your service object at construction > time, we can see about perhaps giving you a pointer to the > AxisEngine or something, but a MessageContext isn't the > appropriate tool here. > > --Glen > > ----- Original Message ----- > From: "Hozefa Botee" > To: > Sent: Thursday, April 04, 2002 6:19 PM > Subject: MessageContext? > > > > If I want to access the MessageContext to add a header to > the response > > from a client call, where is the appropriate place in my > code to call > > MessageContext.getCurrentContext()? if I put it in the > constructor of > > my service with some debugging code, it appears that the > constructor > > gets called twice, and only on the second call is there a non-null > > MessageContext. here's some sample code: > > > > the line 'making demo' shows up twice in my Tomcat window. the > > impl.Demo constructor is where I try to get a handle to the > > MessageContext. > > > > thoughts? > > > > /** > > * DemoSoapBindingImpl.java > > * > > * This file was auto-generated from WSDL > > * by the Apache Axis Wsdl2java emitter. > > */ > > > > package samples; > > > > public class DemoSoapBindingImpl implements samples.Demo { > > > > private impl.Demo myObject; > > > > public DemoSoapBindingImpl() > > { > > try > > { > > myObject = new impl.Demo(); > > System.err.println("making demo"); > > } > > catch(java.lang.Exception e) > > { > > System.err.println("failed making demo"); > > e.printStackTrace(); > > } > > } > > > > public java.lang.String doSomething(java.lang.String in1, > > java.lang.String in2, int in3) throws java.rmi.RemoteException { > > return myObject.doSomething(in1, in2, in3); > > } > > } > > >