Dear Felix,

If I understand correctly then you wish to have n Perl processes calling a single Java 
process which spawns a thread for each call, processes something in the thread, and 
then calls back to the original Perl caller in order to pass back the results, right?

In this case both Perl & Java processes need to be set up as XML RPC servers (in order 
to create this type of asynchronous calling behaviour which is AFAIK not supported by 
the Perl XMLRPC implementations). One way to enable the Java threads to call back with 
the results is to put the XMLRPC server of each Perl process on a different port. When 
the Perl process calls the Java process then the Perl process can pass its port number 
as an argument, and perhaps also a unique identifier in case it invokes more than one 
Java worker thread. This way, when the Java thread calls back then it can pass the 
same identifier back as an argument in order to identify itself.

Hope this helps,

With kind regards,

Simon


> Hi everyone,
> I'm currently developing a rather local (it will probably run on the same
> machine) client-server system to couple perl with java. The result shall be
> this scenario:
>
> - a Perl task sends a message to a Java class to create a new rpc client
> thread
> - the Java client does rpc's at a server implemented by Perl
> - the Perl task continues when Java has done the work
> there can be many instances of perl tasks and java threads, but each client
> belongs to exactly one server
>
> Because of the standardisazion I prefer existing protocolls instead of an
> own implementation of socket communication so I've implemented apache xml-rpc
> (for testing the server is currently also implemented in java).
> Now there's a problem: xml-rpc seems to open a new connection for every
> procedure call so the client doesn't know which server task it belongs to and vv
> when more than one procedure call is done. Is there a solution to use the
> same connection for a particular client-server instance until the Java client
> side has finished ?
> If not, how can I realize many client-server instances (in own threads) so
> that one client belongs to one server and is 100% identificated  ?
> Is xml-rpc the right thing for a local communtication or is it rather only
> appropiate for web-services or long distance communication ?
> Thanks and bye
> Felix

Reply via email to