You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Henner Zeller <ze...@stud.fh-heilbronn.de> on 2001/07/26 07:49:44 UTC

Proxies (was Re: Yesterday's chat log (07/24/01))

Hi,
PP| As far as I know, there is *no* way to do anything with a 
PP| class/interface that doesn't exist at compile time. I'd love for you to 
PP| prove me wrong :) as this would make what I'm trying to do with Apache 
PP| SOAP a bit easier.

Depends how you put it. For _writing_ the proxy code, you don't need to
know the interface beforehand, so its possible to write this in Axis and
later use it. Of course, the _user_ obviously should know what interface
(s)he wants to call.

>From the users' point of view, he calls the proxy with one or more
Interfaces he wants to have implemented (at _this_ point of course, he
should know them, i.e. they should be available at compile time). And at
this time, the user knows what interface to call, because he writes the
application to use the WebService in the first place, right ?

If the user calls an function on this dynamically generated class, it is
dispatched by the proxy and call the InvokationHandler.invoke(...) method,
passing the function name and all the parameters needed. From this, its
easy to wrap this in s SOAP request. The SOAP result then is then simply
returned (that could as well mean, that an Exception is thrown).

It's pretty easy to write a Proxy; for an experimental SOAP
implementation(1), it took me less than an hour. And I must say, dynamic
proxies are the Coolest Thing(tm) in jdk 1.3!

ciao,
 -hen

(1) I was experimenting with Iterators being serialized over the net. If
    the last paramter of a function is an Iterator, or the return values
    is an Iterator, it can already be read on the peer side while it is
    still serialized on the other side. This allows for HUGE sequences to
    be transmitted. On serialization level, an Iterator looks like an
    Vector. A soon as I have time again (this was part of my master's
    thesis I am still working on) I'll have a look how this can be
    integrated into Axis. promised.