newbi question on python rpc server, how it works?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • krishnakant Mane

    newbi question on python rpc server, how it works?

    hello,
    searched a lot of places including google search but can't find
    answers to python-rpc. I am also very new to rpc. I am very clear
    about its meaning and where it is to be used, but not about how it is
    done.
    I have a need where I need to create a layer of business logic that
    will connect to mysql database at one end and a wxpython based thin
    client at the other end.
    can some one give me basic idea as to how I can use simple xml rpc
    server class of python and build an xml rpc server and then a client
    which I can embed in my wxpython based thin client?
    as I said I am not aware of how xml rpc works in details.
    I want to creat the wxpython client app in such a way that it only
    does the work of validation and display and only sending the data as
    is to the xml rpc server for logic and then xml rpc server will
    inturn talk to mysql.
    my business logic consists of many classes which I want to put in a
    package directory with __init__.py and all the other modules.
    do I need to create all of them as xml rpc server instances or can I
    use them into one single xml rpc server class?
    at the other end I am not really understanding how the xml rpc client
    can be used to get data in to my wx based gui?
    for example I want to fill up a list box with data that came from the
    rpc server to the client and then some how looping through the
    elements sent over and putting into a list.

    regards.
    Krishnakant
  • Larry Bates

    #2
    Re: newbi question on python rpc server, how it works?

    krishnakant Mane wrote:
    hello,
    searched a lot of places including google search but can't find
    answers to python-rpc. I am also very new to rpc. I am very clear
    about its meaning and where it is to be used, but not about how it is
    done.
    I have a need where I need to create a layer of business logic that
    will connect to mysql database at one end and a wxpython based thin
    client at the other end.
    can some one give me basic idea as to how I can use simple xml rpc
    server class of python and build an xml rpc server and then a client
    which I can embed in my wxpython based thin client?
    as I said I am not aware of how xml rpc works in details.
    I want to creat the wxpython client app in such a way that it only
    does the work of validation and display and only sending the data as
    is to the xml rpc server for logic and then xml rpc server will
    inturn talk to mysql.
    my business logic consists of many classes which I want to put in a
    package directory with __init__.py and all the other modules.
    do I need to create all of them as xml rpc server instances or can I
    use them into one single xml rpc server class?
    at the other end I am not really understanding how the xml rpc client
    can be used to get data in to my wx based gui?
    for example I want to fill up a list box with data that came from the
    rpc server to the client and then some how looping through the
    elements sent over and putting into a list.
    >
    regards.
    Krishnakant
    I'm no expert, but maybe I can get you started.

    If you understand how a SQL database works you can extend that knowledge
    to RPC. You make queries to the RPC server and it returns responses.
    The format of the queries/responses is "normally" XML, but I'm pretty
    sure you could invent your own if you wanted to (probably a bad idea).
    Basically you define an API (like SQL queries define their API) that is
    used by the clients to make requests, update information, retrieve
    information, etc.

    You probably should take a look at Twisted module. It does XMLRPC with
    just a few lines of code and also would scale well as you have many
    users talking to the server. Download Twisted and take a look. You
    might also want to pick up a copy of "Twisted Network Programming
    Essentials":

    Gain technology and business knowledge and hone your skills with learning resources created and curated by O'Reilly's experts: live online training, video, books, our platform has content from 200+ of the world’s best publishers.


    I'll bet it will be worth the purchase price if you choose to go this
    direction.

    -Larry Bates

    Comment

    • Goldfish

      #3
      Re: newbi question on python rpc server, how it works?

      I have a need where I need to create a layer of business logic that
      will connect to mysql database at one end and a wxpython based thin
      client at the other end.
      Spring Python offers something similar (http://springpython.python-
      hosting.com/wiki/DistributedRemo ting) to link up clients withs
      servers. You can code locally, and then when it is time to split
      things up between different workstations, you can reconfigure the
      networking.

      There is a demo application, PetClinic (http://springpython.python-
      hosting.com/wiki/PetClinic) that shows a database component, remoting
      pieces, and finally a front end. The current version of PetClinic is a
      web app. In the near future, we are planning to build a wxPython front
      end to show more reusability of components.

      Comment

      • krishnakant Mane

        #4
        Re: newbi question on python rpc server, how it works?

        hello all,
        I have downloaded the entire twisted library.
        I am also trying to read the documentation but I have a couple of
        problems right now.
        firstly, I did not find any thing in twisted documentation that
        specifically talks about xml rpc. am I missing some thing?
        secondly, if I am writing an entire application with its logic in an
        xml rpc server, do I have to create all my classes as instences of xml
        rpc server (just like I create a java servlet or a php script)? or is
        it that I just create one xml rpc server class which is like the entri
        point for all other classes in the package?
        can you provide a couple of links to howtos or tutorials on creating
        xml rpc servers and clients with twisted python? I am also confused
        as to how will I mix the functionality of MySQLDB with twisted python?
        I am asking this because I felt twisted much cleaner to use than the
        modules coming with python itself. again I may be wrong and some one
        might point me to the possible problems with this aproach in the long
        run.
        regards.
        Krishnakant.

        Comment

        Working...