473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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
Mar 28 '07 #1
3 1679
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":

http://www.oreilly.com/catalog/twistedadn/

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

-Larry Bates
Mar 28 '07 #2
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/DistributedRemoting) 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.

Mar 28 '07 #3
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.
Mar 29 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Christoffer T | last post by:
Sorry for bad subjekt. I have just started to learn programing, and python sound like a god choice. But there is something I do not understand. I want to write the code in notepad, and then...
13
by: Ajay | last post by:
hi! can you call a Python application from a Java program? does this require any additional package to be installed? thanks cheers
2
by: Amadelle | last post by:
Hi all and thanks in advance, I have written a class library in C# (a set of cs classes) which I would like to install on our production webserver. It is used by some of the asp.net pages that...
37
by: John Salerno | last post by:
I contacted my domain host about how Python is implemented on their server, and got this response: ------------------- Hello John, Please be informed that the implementation of python in our...
2
by: krishnakant Mane | last post by:
hello, I am a new member to this list. I am Krishnakant from India, Mumbai. I have been coding in python for quite some time and now I am at the intermediate level of programming as far as python...
9
by: Larry Bates | last post by:
Does anyone know if there is a way to make a Python COM object act like a proper iterator in VB/Delphi? Example: Python COM object class foo: _public_methods_=
1
by: 6655326 | last post by:
Newbi needs a very small help, thank you very much. Hello everyone and thank you very much for your time. I Have a small db for invoicing and on my form (with a subform) there is a CANCEL...
4
by: Connie McBride | last post by:
I am a long time Delphi programmer. I am starting to work with c#. I have a couple of questions on how to define connection settings on the fly, since I have many client sites, each with their own...
5
by: walterbyrd | last post by:
I don't know much php either, but running a php app seems straight forward enough. Python seems to always use some sort of development environment vs production environment scheme. For...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.