axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Henke" <stefanhe...@gmx.de>
Subject AW: Registering service in uddi registry when startup
Date Thu, 19 Sep 2002 08:44:39 GMT
Hi Eric,

I already thought  of doing this. I implemented a short example, but I
recognized that the init() method is called if the service is called the
first time by a client.
But what I need is a method that is invoked when the whole servlet engine
starts up. So, the first call of the service is too late

Thanks
Stefan

-----Ursprüngliche Nachricht-----
Von: Jung, Eric (Contractor) [mailto:ejung@russellmellon.com]
Gesendet: Mittwoch, 18. September 2002 20:07
An: 'axis-user@xml.apache.org'
Betreff: RE: Registering service in uddi registry when startup


Hi Stefan,
Try using the wsdl4reg http://sourceforge.net/projects/wsdl4reg, by Olivier
Brand, in Axis lifecycle methods. It should be straightforward.

For example:

public final class MyService implements
javax.xml.rpc.server.ServiceLifecycle {

  public final String getStockQuote(String symbol) {
    // do stuff
  }

  /*
   * Implementation of javax.xml.rpc.server.ServiceLifecycle.init()
   * Called by Axis when its starts this service
   */
  public final void init(final Object context) {
    //register with UDDI registry
    if (context instanceof ServletEndpointContext) {
      final ServletEndpointContext sec = (ServletEndpointContext)context;
      ServletContext sc = sec.getServletContext();
      //do stuff with wsdl4reg
    }
  }
  /*
   * Implementation of javax.xml.rpc.server.ServiceLifecycle.destroy()
   * Called by Axis when its destroys this service
   */
  public final void destroy() {
    //unregister from UDDI registry
    //do stuff with wsdl4reg
  }
}

Let me know if that helps,
Eric H. Jung

-----Original Message-----
From: Stefan Henke [mailto:stefanhenke@gmx.de]
Sent: Wednesday, September 18, 2002 1:02 PM
To: axis-user@xml.apache.org
Subject: Registering service in uddi registry when startup


Hi,

I´m looking for a way to do the following with axis. Maybe you can help me.

I have deployed a webservice using axis sucessfully. Each time the server
which hosts the service starts up, it should automatically register the
service in a uddi registry. Vice a versa, the service has to be unpublished
when the server shuts down.
Maybe there is a way by overwriting the axis servlet and use the servlet
lifecycle methods. But I´m not 100% familiar with the servlet lifecycle.

Thanks
Stefan


Mime
View raw message