Re: Context in webservices

From: Binildas C. A. <binildas_at_IBSPLC.COM>
Date: Sun, 12 May 2002 10:28:27 +0530

import javax.xml.rpc.server.ServiceLifecycle;

public class SunRegImpl implements SunRegPort, ServiceLifecycle {

        private String dbUrl;

        public void init(Object context) {

                dbUrl =

        public void destroy() {

                //release the database connection
        // Other code goes here


Everything else remains the same. There is a descriptive article on
JAX-RPC in Sun's site by Arun and Beth, from where I have tried the above
piece of code...

Binildas C. A.
IBS Software Services (P) Ltd.
521-524 / NILA
Technopark Campus
Trivandrum - 695 581, India
Tel : ++91 - 471 - 700080 (Extn. 4272)
Fax : ++91 - 471 - 700078

Armond Avanes <armond333_at_YAHOO.COM>
Sent by: Public discussion on JAX-RPC <JAXRPC-INTEREST_at_JAVA.SUN.COM>
05/12/02 09:47 AM
Please respond to Public discussion on JAX-RPC

        Subject: Re: Context in webservices

Hi Botond,

Would you please provide me the peice of code you've
used to reach into context from your web service class
I need to have session tracking on my web services.

Best Regards,

Thanks, thats working.

Another question would be, how can I deploy different
webservices in the same web application? I managed to
access the ServletContext, but the different
webservices use different ServletContexts. I know that
the ServletContexts are different for the individual
web applications, so I figured out, that the solution
would be to deploy my webservices in the same web

Regards, Botond.

Simon Horrell wrote:

>Have a look at the JAX-RPC spec and check the
>javax.xml.rpc.server.ServiceLifeCycle interface. The
Web service
>endpoint class may implement this interface. Its
init() method has a
>single parameter which is a
>implementation provided by the JAX-RPC runtime
implementation. This
>allows access to the underlying
>javax.servlet.http.HttpSession etc. Note that the
parameter of the
>ServiceLifeCycle.init() method used to be a
>javax.servlet.ServletContext in earlier specs. Si.

Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience