473,809 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting up test for XML-RPC

I'm trying to test out Python XML-RPC for the first time, and can't find
anything that executes a call end to end.

I thought that I would use SimpleXMLRPCSer ver to run a simple server on
localhost, and xmlrpclib to run a client that connects to it, but they don't
seem to register the same functions. The server test code registers 'pow'
and 'add' (in the Python 2.3 distribution) but the client seems to call
"print server.examples .getStateName(4 1)". It doesn't seem like they were
meant to work together as a unit test, although that would seem logical.

Can anyone help me just get a single XML-RPC call to execute (and I want to
see both the client and server code)? I have googled extensively and
haven't come up with anything.

Also -- I'm investigating this for a nightly build process involving many
machines. There is going to be a master machine that sends requests to 20
other machines to build things. They're just a bunch of Windows XP
machines, with almost no software on them. What software would I need to
install to run XML-RPC servers on them to receive requests? Just Python and
a web server like Apache?

If there are any other _very_ lightweight RPC mechanisms, I would appreciate
hearing about them. I am writing some build scripts in Python, and while I
could for example schedule a task on 20 machines separately, it would be
nicer to have a master machine control when the build happened, etc. and be
able to manage dependencies by waiting for a return result, etc. All I want
to do is execute a python function on a remote machine and get a result
back. It is all done in a local, secure environment.

Thanks for all the previous responses to my questions -- this newsgroup has
been very helpful.

MB
Jul 18 '05 #1
4 2054
OK, I tried the obvious and it worked. : ) I just changed the call to
server.pow(3,5) and it returns the correct result. I wonder why they aren't
set up that way in the first place.

But the second question still stands. I am running both the client and
server on my own machine now (Windows 2000). Would I just need Python and
web server if they were different machines? I would like to avoid
installing a bunch of software on the 20 machines if possible.

thanks,
MB

"Moosebumps " <cr**@crud.co m> wrote in message
news:cD******** *********@newss vr29.news.prodi gy.com...
I'm trying to test out Python XML-RPC for the first time, and can't find
anything that executes a call end to end.

I thought that I would use SimpleXMLRPCSer ver to run a simple server on
localhost, and xmlrpclib to run a client that connects to it, but they don't seem to register the same functions. The server test code registers 'pow'
and 'add' (in the Python 2.3 distribution) but the client seems to call
"print server.examples .getStateName(4 1)". It doesn't seem like they were
meant to work together as a unit test, although that would seem logical.

Can anyone help me just get a single XML-RPC call to execute (and I want to see both the client and server code)? I have googled extensively and
haven't come up with anything.

Also -- I'm investigating this for a nightly build process involving many
machines. There is going to be a master machine that sends requests to 20
other machines to build things. They're just a bunch of Windows XP
machines, with almost no software on them. What software would I need to
install to run XML-RPC servers on them to receive requests? Just Python and a web server like Apache?

If there are any other _very_ lightweight RPC mechanisms, I would appreciate hearing about them. I am writing some build scripts in Python, and while I could for example schedule a task on 20 machines separately, it would be
nicer to have a master machine control when the build happened, etc. and be able to manage dependencies by waiting for a return result, etc. All I want to do is execute a python function on a remote machine and get a result
back. It is all done in a local, secure environment.

Thanks for all the previous responses to my questions -- this newsgroup has been very helpful.

MB

Jul 18 '05 #2

MB> OK, I tried the obvious and it worked. : ) I just changed the call
MB> to server.pow(3,5) and it returns the correct result. I wonder why
MB> they aren't set up that way in the first place.

The xmlrpclib module predates SimpleXMLRPCSer ver by a fair amount. The
getStateName() test was meant to connect to UserLand's original test server.
As I recall, that was the sole function it exported. I don't see any reason
why SimpleXMLRPCSer ver needs to implement getStateName(), but I imagine it
would be reasonable for xmlrpclib's test to call pow().

MB> But the second question still stands. I am running both the client
MB> and server on my own machine now (Windows 2000). Would I just need
MB> Python and web server if they were different machines? I would like
MB> to avoid installing a bunch of software on the 20 machines if
MB> possible.

You should be able to build a server and a client with just the standard
Python distribution. If performance is an issue (it will be if you are
passing large chunks of data back and forth), there are some things you can
do to speed it up:

* Install Fredrik Lundh's sgmlop module.

* Marshal or pickle your data first, then base64 encode them before
passing them to or fro. This greatly reduces the number of XML tags
on-the-wire, and thus the encode/decode time and data size.
Obviously, this only works if you are talking Python-to-Python.

* Tweak things to gzip-encode the traffic between server and client.

* Use the xmlrpclib.Multi Call class to bundle logical multiple calls
into a single physical XML-RPC call.

Skip

Jul 18 '05 #3
> MB> But the second question still stands. I am running both the
client
MB> and server on my own machine now (Windows 2000). Would I just need MB> Python and web server if they were different machines? I would like MB> to avoid installing a bunch of software on the 20 machines if
MB> possible.

You should be able to build a server and a client with just the standard
Python distribution.
Really? That would be awesome. But I don't see how that works... what do
you enter for the URL? (right now it is just http://localhost, but
obviously I would need to specify 20 different machines for my system. They
are just bare Windows XP Pro machines with a default installation. They're
"Windows Server" machines, I don't think.

If performance is an issue (it will be if you are passing large chunks of data back and forth), there are some things you can do to speed it up:

* Install Fredrik Lundh's sgmlop module.

* Marshal or pickle your data first, then base64 encode them before
passing them to or fro. This greatly reduces the number of XML tags
on-the-wire, and thus the encode/decode time and data size.
Obviously, this only works if you are talking Python-to-Python.

* Tweak things to gzip-encode the traffic between server and client.

* Use the xmlrpclib.Multi Call class to bundle logical multiple calls
into a single physical XML-RPC call.


Thanks for these suggestions.

MB
Jul 18 '05 #4
You should be able to build a server and a client with just the
standard Python distribution.


MB> Really? That would be awesome. But I don't see how that
MB> works... what do you enter for the URL? (right now it is just
MB> http://localhost, but obviously I would need to specify 20 different
MB> machines for my system. They are just bare Windows XP Pro machines
MB> with a default installation. They're "Windows Server" machines, I
MB> don't think.

Doesn't matter. Suppose you ran the server on win.foobar.tv, listening to
port 1234. In the client you'd call ServerProxy like so:

server = ServerProxy("ht tp://win.foobar.tv:1 234")
print server.exanples .echo("My dog has fleas")

Skip

Jul 18 '05 #5

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

Similar topics

8
2724
by: StepH | last post by:
Hi, I've this module : from optparse import OptionParser import re _version = "P1" def writeVar(f, line):
9
2024
by: Weekend | last post by:
Currently, i want to develope a multiple choice exam website. The content of the test is store in an XML file. I want to carry out some function. Could you tell me which programming language should i use? 1.A page that display the content of the XML file. (JavaScript, JSP, XSL, DOM, DSO ActiveObject control ?) 2.A page that Give the feeback to the users who finished the exam. (this part i would like to use JSP) 3.A page that enable me to...
4
3550
by: Ian | last post by:
I would like to set a path to a schema where both the xml file and the schema are on my local hard drive (e.g. c:\XML\auto.xml and c:\XML\auto.xsd) Thank you, Ian
8
1269
by: Wayne Wengert | last post by:
I am trying to build a VB.NET Windows application in which I want to create an XML file from data collected from the user and stored in arrays. I am looking for any pointers to information on how to accomplish this. TIA Wayne
11
9283
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
2
1770
by: Greg | last post by:
Please note: I have cross posted this from Newsgroup: microsoft.public.dotnet.framework.aspnet.webservices with a few minor changes... I am having a simple problem setting up the security on my test web service... My Web service code is: Imports System.Web.Services
4
16742
by: michael sorens | last post by:
I have successfully bound an XmlDocument to a DataGridView but all fields seem to be strings. I want to retrofit appropriate datatypes on some of the fields. Let me take this in 2 parts. Part I: I found the ValueType field, leading me to believe that I could say dataGridView.Columns.ValueType = typeof(Double); dataGridView.Columns.ValueType = typeof(Integer); etc.
1
1977
by: Sam | last post by:
I am working with .Net 2.0. I found a 2002 posting with this sample code of how to send a node-set into a XSLT transformation: string xml = @"<foo><bar>The Test</bar></foo>"; string xsl = @"<xsl:stylesheet xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" version=""1.0""> <xsl:param name=""param1""/> <xsl:template match=""/""> bar element from param1 value:
6
3002
by: bruce_phipps | last post by:
If I have an <element name="test" maxOccurs="unbounded"> with no minOccurs attribute specified does this mean I can have 0..unbounded occurences of <test>? Or 1..unbounded occurences of test? Thanks Bruce
1
2237
by: sidathkp | last post by:
Here is a sample of the xml file that I have: <provider> <cinames> <cinema> <id>1111</id> <name>ABC cinema</name> <address>123 street</address> </cinema> <cinema>
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9602
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
10639
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
10376
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...
1
10383
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
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...
1
7661
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.