Hi Matthew,
Here is a very simple example that might help you:
final TransportRegistry registry = new TransportRegistry();
final Client client = new Client(registry.createSession("
http://my.host/webapp/JSON-RPC/"));
final MyInterface myObject = (MyInterface) client.openProxy("myObject", MyInterface.class);
myObject.myMethod(args);
So you need to have an interface that the client object can create a proxy for.
The asynchronous version of this code makes using the client a bit more like the javascript version, in which you can provide a callback method that executes when your call has finished. For the http transport, this means it is run on a separate thread (since HttpClient does not natively support asynchronous calls). It is, however, possible to add your own transports that do support asynchronous calling. For more information, see bug #64 (
http://issues.jabsorb.org/show_bug.cgi?id=64).
HTH,
(Your Dutch namesake,) Matthijs
@Arthur: My latest patch to bug #64 contains some fixes and some extra unit tests. I think the bug can be closed anyhow since the main functionality was committed to trunk, but it would be nice if this patch was committed as well. So I wouldn't have to have a patched version of the code.
Regards,
Matthijs