You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by eb...@arcor.de on 2006/05/21 16:24:05 UTC

ServiceLifecycle

Hello,

I figured out if I add the same code not in my impl class but instead in the
xxxSkeleton class it works fine.

  public void init(Object context) {
    System.out.println("*** init ***");
    javax.xml.rpc.server.ServletEndpointContext sc =
      (javax.xml.rpc.server.ServletEndpointContext) context;

    org.apache.axis.MessageContext msgContext =
(org.apache.axis.MessageContext) sc
        .getMessageContext();
    String userID = msgContext.getUsername();
    String password = msgContext.getPassword();
    System.out.println("userID: " + userID);
    System.out.println("password: " + password);
  }

  public void destroy() {
    System.out.println("*** destroy ***");
  }

Now it prints username and password correctly.

This skeleton class has a method:
  public ServiceBindingSkeleton() {
    this.impl = new com.name.ServiceImpl();
  }

which calls the real business logic. This business methods works also.
Why can I not add the ServiceLifecycle interface to my ServiceImpl class?

Is this an Axis Bug?

Regards, Ralph

> -----Ursprüngliche Nachricht-----
> Von: ebaykunde@arcor.de [mailto:ebaykunde@arcor.de]
> Gesendet: Sonntag, 21. Mai 2006 14:57
> An: axis-user@ws.apache.org
> Betreff: AW: Path from the webapp
> 
> Hi,
> 
> first thanks for your help but I have still problems with this.
> 
> First I think you meant the javax.xml.rpc.server.ServiceLifecycle
> and not the ServletLifecycle interface?
> 
> I tried now code like this
> http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.
> 
> The big problem is, that the init Method is never called. I am using
> Tomcat
> 5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.
> 
> This problem keeps me busy now more than 3 hours and I'm too stupid to
> find
> a solution. That's why, please help me.
> 
> I also tried to add this class as listener in web.xml?!
> 
> In an handler class this is no problem but in a service class....
> 
> Additional hints for me?
> 
> Regards,
> Ralph
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Dies Koper [mailto:dies@jp.fujitsu.com]
> > Gesendet: Donnerstag, 18. Mai 2006 12:01
> > An: axis-user@ws.apache.org
> > Betreff: Re: Path from the webapp
> >
> > Hello Ralph,
> >
> > Check out the JAX-RPC spec.
> > You can get to the servlet context by implementing the ServletLifecycle
> > interface in your implementation class.
> >
> > Regards,
> > Dies
> >
> > ebaykunde@arcor.de wrote:
> > > Hi,
> > >
> > > I use Axis 1.4.
> > >
> > > In the axis web app I have a directory 'update'.
> > > In my service implementation I want to read the files in the
> directory.
> > > String directory = ...;
> > > File file = new File(directory);
> > >
> > > The first problem is how I can get the string directory dynamically
> from
> > the
> > > xxxServiceBindingImplementation. I have no servlet context there.
> > > I need the directory in the form like d://tomcat/webapps/update.
> > >
> > > Another problem:
> > > Can I get the url from the xxxServiceBindingImplementation for
> instance:
> > > http://localhost:8080/myapp?
> > >
> > > Can anybody help me?
> > >
> > > Thanks!
> > >
> > > Regards,
> > > Ralph
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org