There are some other ideas and the general principle here:
http://nagoya.apache.org/wiki/apachewiki.cgi?AxisProjectPages/DeployedServiceTocall

Jeff
----- Original Message ----- 
From: "Anand Natrajan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 14, 2004 7:30 AM
Subject: Re: Calling different WS than specified in client


> Hi!
>
> I tried something like this about a year ago - it's tricky. I'll try to
> explain what I did using your terminology.
>
> In my case as well, the client would invoke a method on MyService, but I
> wanted the same method to be forwarded to CommonService. What I found out
> quickly was that unless MyService is deployed, Axis will fail immediately
> saying "No such method/service".
>
> My next bright idea was to do on-demand deployment. Here, when the user
> first invokes MyService.method(), I would intercept the call in a handler,
> check if MyService was deployed, and if it wasn't, I would generate the
WSDD
> for MyService and deploy it. Then, I would forward the call to the
> newly-deployed MyService, which then forwarded to CommonService.
>
> This approach worked partially. I was able to intercept the call
correctly,
> detect whether or not MyService was deployed and generate the WSDD. In the
> WSDD I made sure to mention that the service class was MyServiceImpl.java.
I
> wrote MyServiceImpl.java to have all of the methods that were there in
> CommonServiceImpl.java, but the implementations didn't do much. For every
> MyServiceImpl.method(), I simply forwarded the call to
> CommonServiceImpl.method(), perhaps after adding a parameter or two.
>
> However, where I got stuck was trying to convince Axis that MyService had
> been deployed. I tried many things including shoving responses into the
> return, but it would fail. My understanding from this experience is that
> when your client invokes MyService.method(), Axis constructs the handler
> chain before actually invoking any handlers. The first time your client
> invokes MyService.method(), MyService has NOT been deployed, therefore it
> doesn't appear in the handler chain. At that point, no matter what you do,
> the call is doomed to fail. Of course, I would proceed and deploy
MyService,
> but it would be useless - the call would always fail.
>
> However, the second call to any of MyService's methods would work because
> this time around Axis was able to find MyService and insert it into the
> handler chain. All subsequent calls would also succeed. As a result, we
had
> to explain to our clients to ignore the failure on the first method
> invocation and try again. What we did was provide a dummy method in
> MyService whose main job was to make the on-demand deployment happen. The
> results/failures of the dummy method were ignored.
...
> On Tue, 14 Sep 2004 [EMAIL PROTECTED] wrote:
>
> :  I want to call a WS called for example MyService but MyService isn't
> : deployed in Axis (or anywhere else). Instead I want other WS to be
> : called, for example CommonService (wchich is deployed of course) and a
> : file MyService.txt to be passed as an argument for CommonService. I
> : thought that I might write a handler to be processed in global chain
that
> : substitutes MyService with CommonService and adds argument (path to
> : MyService.txt) but that does not change anything. What am I doing wrong?

Reply via email to