473,698 Members | 2,883 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1694
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/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.

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
1570
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 open in a window. I use win98. I have tried to write "python file.py" in run, but it just very fast open and close dos window. So what should I do to get to show the program.
13
3340
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
1097
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 I have written. Everything ofcourse works great on my local system. I have the class library set up as a different project with a different path from the website addresses. I can see when I change the configuration manager settings to Release...
37
2489
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 server is through mod_python integration with the apache. These are the steps needed for you to be able to run .py script directly
2
2460
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 is concerned. I am going to develop a accounting software that can work on the console and accessed through ssh from other terminals. I will like to use the curses or ncurses library for the menus and the input forms with add, save, delete,...
9
2303
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
1455
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 button which will just cancel what had been selected or entered in the form ... here is the code behind the cancel button...
4
1196
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 database setup differently as far as name, server name etc. Pretty common. My Delphi App uses components to retrieve avaliable server names and available database names, then I wrote code to build the connection string. I am trying to find...
5
1640
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 development, you are supposed to run a local browser and load 127.0.0.1:5000 - or something like that. Then to run the same thing in a development environment, I have to configure some files, or touch all the files, restart the web-server, or something....
0
8610
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7740
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.