I have a remote method created via Python web2py. How do I test and invoke the method from Java?
I was able to test if the method implements @service.xmlrpc
but how do i test if the method implements @service.run
?
I have a remote method created via Python web2py. How do I test and invoke the method from Java?
I was able to test if the method implements @service.xmlrpc
but how do i test if the method implements @service.run
?
I'd be astonished if you could do it at all. Java RMI requires Java peers.
You have to write an interface X extends Remote declaring a method "myMethod()".
X x = (X)Naming.lookup( "//a/b/c" );
x.myMethod();
One of the difficulty is to manage the Naming at server side.
This is not possible unless you use some kind of java-python bridge (jython) and that would still be Java RMI i.e. a java program calling another java program which wraps your python scripts.
If the question can be interpreted loosely as "using Java to invoke Python method" (if you do not need to use Java RMI specifically) then there are other frameworks you can use for bridging Java and python. E.g. one open source licensed alternative is Versile (full disclosure: I am one of the developers). See Versile Python and Versile Java documentation for examples of usage.