How can I call a python method from the XML-RPC client in Java?

Discussion in 'Python' started by evelyne0510@gmail.com, Apr 20, 2006.

  1. Guest

    Hi all,
    I have created a XML-RPC model (with server and client) written in
    Java.
    I want to call the methods in another XML-RPC model written in
    Python.
    I know that in Java, I can use like
    "xmlrpc_client.excute("handler_name.method", param)" to call the
    methods in my xml-rpc server written in java.
    But how can I call the methods in Python? I cannot creat a handler
    in my Python XML-RPC server.....

    Is there anyone able to help me? I would be very appreciate!
    Thanks!

    Evelyne
     
    , Apr 20, 2006
    #1
    1. Advertising

  2. wrote:
    > Hi all,
    > I have created a XML-RPC model (with server and client) written in
    > Java.
    > I want to call the methods in another XML-RPC model written in
    > Python.
    > I know that in Java, I can use like
    > "xmlrpc_client.excute("handler_name.method", param)" to call the
    > methods in my xml-rpc server written in java.
    > But how can I call the methods in Python? I cannot creat a handler
    > in my Python XML-RPC server.....
    >

    Not sure what you mean by 'creating a handler in your Python RPC
    server', but if you just want to use the Python XMLRPC library to make a
    call to an XMLRPC server, there's an example in the documentation:

    http://docs.python.org/lib/xmlrpc-client-example.html

    Hope that helps.

    Cheers,

    Guido
     
    Johnny deBris, Apr 21, 2006
    #2
    1. Advertising

  3. Eric Brunel Guest

    On 20 Apr 2006 11:31:23 -0700, <> wrote:

    > Hi all,
    > I have created a XML-RPC model (with server and client) written in
    > Java.
    > I want to call the methods in another XML-RPC model written in
    > Python.
    > I know that in Java, I can use like
    > "xmlrpc_client.excute("handler_name.method", param)" to call the
    > methods in my xml-rpc server written in java.
    > But how can I call the methods in Python? I cannot creat a handler
    > in my Python XML-RPC server.....


    I'm not quite sure I understand the question. You seem to say that you
    have both a client and a server in Java, and Python server. That means one
    client and 2 servers, right? Are both servers up and running? IOW, do you
    have a problem to *call* the Python server from the Java client, or to
    *write* the Python server? Can you post some code (maybe not the full one,
    but a simpler version showing what you're trying to do and what does not
    work)?
    --
    python -c "print ''.join([chr(154 - ord(c)) for c in
    'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"
     
    Eric Brunel, Apr 21, 2006
    #3
  4. wrote:
    > Hi all, I have created a XML-RPC model (with server and client)
    > written in Java. I want to call the methods in another XML-RPC model
    > written in Python. I know that in Java, I can use like
    > "xmlrpc_client.excute("handler_name.method", param)" to call the
    > methods in my xml-rpc server written in java. But how can I call the
    > methods in Python? I cannot creat a handler in my Python XML-RPC
    > server.....
    >
    > Is there anyone able to help me? I would be very appreciate!


    It's not clear to me what you are trying to do: Do you want to
    know how to write certain Java code (as the subject line
    suggests), or how to write certain Python code (as "I cannot
    create a handle in my Python XML-RPC server" suggests").

    I'm going by the subject: As a first step, please try calling
    the demo server in SimpleXMLRPCServer in Java. To do this,
    start the demo servre, point your Java client to
    http://localhost:8000/RPC2, and invoke
    xmlrpc_client("add", new args[]{1, 2}) (or some such, I'm not sure
    how parameter passing in your library works).

    You are right that there typically is no "handler" in Python,
    so you just omit the handler_name part of the method string.

    Regards,
    Martin
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Apr 23, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rhimbo
    Replies:
    0
    Views:
    5,488
    rhimbo
    Mar 16, 2006
  2. Pere Montolio

    XML RPC to ONC XDR RPC

    Pere Montolio, Aug 11, 2004, in forum: XML
    Replies:
    0
    Views:
    729
    Pere Montolio
    Aug 11, 2004
  3. Ymtrader
    Replies:
    1
    Views:
    584
    Adam Tauno Williams
    Mar 15, 2011
  4. Shirish Joshi

    Ruby and Sun-RPC or ONC-RPC ?

    Shirish Joshi, Apr 7, 2004, in forum: Ruby
    Replies:
    0
    Views:
    197
    Shirish Joshi
    Apr 7, 2004
  5. Vladimir Konrad

    rpc (not xml-rpc)

    Vladimir Konrad, Sep 2, 2005, in forum: Ruby
    Replies:
    5
    Views:
    137
    Austin Ziegler
    Sep 3, 2005
Loading...

Share This Page