Ah, you need access to 'context'. I'd say perhaps you need to implement a
'Handler'. You could take a quick look at samples\example4 which implements
a simple LogHandler.
public class LogHandler extends BasicHandler {
public void invoke(MessageContext msgContext) throws AxisFault;
}
As you can see, the handler will have access to the MessageContext object --
which should yield access to all kinds of good stuff! ;)
Read up on Handlers in general too -- user's guide & architecture guide.
I'm kinda new to Axis m'self, and haven't explored every aspect of it yet
(writing my own Handler is one of the things I haven't needed to do yet) --
so I might not be providing 'good info' -- beware!
-----Original Message-----
From: Milind Gadre [mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 10:37 AM
To: [EMAIL PROTECTED]
Subject: Re: Newbie requests help with developing service classes on
Axis
I guess I am not being entirely clear about what I want to do. Perhaps
I am mixing up the Service class with extending the AxisServer (or
perhaps AxisServlet??) class.
With a Servlet, I get access to a ServletContext as well as the Session
via the Request and Response objects. With the (example) TestMsg I just
have a raw object with a method that gets invoked, but that is clueless
about its operating environment.
Perhaps I should ask - how can I extend the default AxisServer (or
AxisServlet??) so the actual service implementing class has more
knowledge of its environment??
Thanks and regards...
> There's always the constructor... ;)
> I guess the absence of a notion like an init() method is a
consequence of
> Axis not enforcing implementation of a specific interface [by your
service
> handler] -- which is nice.
> Can you think of a reason why the constructor would not work for you
as a
> place to do initialization?
>
>
> -----Original Message-----
> From: Milind Gadre [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 28, 2003 9:59 AM
> To: [EMAIL PROTECTED]
> Subject: Newbie requests help with developing service classes on Axis
>
>
>
> Hi,
>
> I am new to Axis and wanted to better understand the protocol for
> initializing the object that actually services the SOAP request?
> Example, in my deploy.wsdd file I have
>
> <service name="MyMsgService" style="message">
> <parameter name="className" value="MyMsgServiceClass" />
> <parameter name="allowedMethods" value="processRequest" />
> </service>
>
> Just like with a Servlet, I would like to have some initialization
> control over an instance of MyMsgServiceClass. According to the
> samples.message.TestMsg class that ships with Axis, there is no
> initialization control.
>
> Example: we have the Servlet.init() method that allows the servlet
> object to be initialized before any methods are accessed.
>
> Is there a similar protocol for service handlers??
>
> Regards...
>
> Milind Gadre
> VP Product Development
> ecPlatforms, Inc
> 901 Mariner's Island Blvd, Suite 565
> San Mateo, CA 94404
> C: 510.919.0596
> E: [EMAIL PROTECTED]
>
>
>