Hi there, I'm afraid I haven't clearly described my question last time. I repost my question. Hope somebody can help me. I have solved the first question: use AdminClient to successfully deploy the service. Second question: how to deploy an object(be instantiated before any call) as Web Service in application scope -- put in another words, how and where should I put the object in engine, so it can be called (invoked) directly from engine, not from classloader. As I know, JavaProvider and its sub RPCProvider, does magic things, but haven't find any clue.
What I did doesn't work: Agent agent = new Agent(); engine.getApplicationSession().set(serviceName,agent); Thanks, -Hui Deng --- Hui Deng <[EMAIL PROTECTED]> wrote: > Date: Tue, 14 May 2002 23:17:26 -0700 (PDT) > From: Hui Deng <[EMAIL PROTECTED]> > Reply-to: [EMAIL PROTECTED] > Subject: deploy an object as Web Service > (application scope) > To: [EMAIL PROTECTED] > > Hi all, > > Before my questions, here is what I'm trying to do: > > I'm writing a MobilityAxisServlet, it's basically > an AxisServlet with couple other components. These > components enable this servlet to accept mobile > agents. Upon the arrival of agent, the servlet > deploys > the agent as Web Service, makes the service agent > provides available online. > To achieve it, I guess I need to do two things as I > dig through some old threads. First, is to deploy > the > service upon the arrival of agent (add deploy desc > to > in-memory engine configuration, but not to > server-config.wsdd as my case). Second, put the > agent > (actually an object) into somewhere (I�m still > struggling with it) at application scope. > My question is how to do it in term of coding. I�m > newer to Axis, and spend some time on it, but may > not > be enough to solve it. What I did so far doesn�t > work. > I got confused, because there are several points to > deploy service, but I�m not getting there. > > I construct the deploy string serviceStr, then try > to use XMLStringProvider to dynamically deploy the > services whenever the agents arrive ( or I should > use > AdminClient as better solution?): > > String serviceStr = "<deployment > xmlns=\"http://xml.apache.org/axis/wsdd/\"" + > " > xmlns:java=\"http://xml.apache.org/axis/wsdd/providers/java\">\n" > + > "<service name=\"MyService\" > provider=\"java:RPC\">\n" + > "<parameter name=\"className\" > value=\"samples.userguide.example3.MyService\"/>\n" > + > "<parameter name=\"methodName\" > value=\"*\"/>\n" + > "</service>\n" + > "</deployment>"; > try{ > XMLStringProvider xml = new > XMLStringProvider(serviceStr); > xml.configureEngine(engine); > System.out.println("reconfigure the > engine."); > > }catch(ConfigurationException ex){ > > } > > Since the service object (java object) is not > instantiate from class file, it�s already there, I > used the following code to deploy it: > Object agent = (Agent)e.getAgent(); > // put object in application scope session > String serviceName = > agent.getClass().toString(); > // Remove the word "class": > if(serviceName.indexOf("class") != -1) > serviceName = > serviceName.substring(6); > System.out.println(serviceName); > log.debug(serviceName); > > engine.getApplicationSession().set(serviceName, > agent); > > Am I correct? I need direction to explore Axis API > to > get there. > > Thanks, > > -Hui Deng > > > __________________________________________________ > Do You Yahoo!? > LAUNCH - Your Yahoo! Music Experience > http://launch.yahoo.com __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com
