473,385 Members | 2,014 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,385 software developers and data experts.

Using CGI to interface with an XML-RPC server

Hi all,

Assume I have a working XML-RPC server that runs persistently and
correctly accepts remote calls, executes the relevant code and outputs
the XML-RPC result. This is fine when using an XML-RPC client.

However, I wish to provide a web user interface. I gather it is
possible to use PHP as an XML-RPC client but I am unable to do so
because of artificially imposed server constraints. All I am able to
use is good the old CGI.

Is it possible to create python CGI scripts that accept form data in
the usual way, package them as an XML-RPC request, call the server,
receive the response then format this response into valid HTML to be
emitted to the client? Is this desirable (what I mean is... is there an
easier way?).

Is there a better way to use a web browser as what is essentially an
XML-RPC client?

FYI, I know that is seems like using XML-RPC in this case is
pointless.. it isn't, some users do indeed use the server as intended.

Cheers,

Jan 17 '06 #1
4 1355
Please? I really could do with some help!

Jan 18 '06 #2
Rob Cowie wrote:
Is it possible to create python CGI scripts that accept form data in
the usual way, package them as an XML-RPC request, call the server,
receive the response then format this response into valid HTML to be
emitted to the client?


Python ships with cgi and xmlrpc support (cgi and xmlrpclib, respectively),
so I'm not sure why you even think you have to ask...

1. use cgi to parse form data
2. use xmlrpclib to issue request
3. use print or your favourite html templating library to generate
output

(it might be a good idea to check with your web server admins, though,
to make sure they don't have a problem with outgoing HTTP requests)

</F>

Jan 18 '06 #3
>Python ships with cgi and xmlrpc support (cgi and xmlrpclib, respectively),
so I'm not sure why you even think you have to ask...
1. use cgi to parse form data
2. use xmlrpclib to issue request
3. use print or your favourite html templating library to generate
output

(it might be a good idea to check with your web server admins, though,
to make sure they don't have a problem with outgoing HTTP requests)


So it is possible.

I'm aware of cgi and xmlrpc modules. The reason I have asked is that
there appears to be much difficulty when tying these two things
together. I also wanted to see if anyone mentioned CGIXMLRPCserver
which is part of the stdlib. I am unsure if this is what I am looking
for. I have been unable to fully comprehend the documentation.

Thanks for your help.

Jan 18 '06 #4
Rob, your python cgi script is just like any other script -- simply
import the xmlrpc lib and use it. The client accessing your cgi
script will have to wait while your script goes off acting as an
xml-rpc client doing whatever business it has to do.

Jan 18 '06 #5

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

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
18
by: comcast | last post by:
Hello all, I am developing an interface system for an application I was written. This interface will connect to other system to share information. I would like to use xml and xsl to generically...
0
by: Jari Kujansuu | last post by:
I am trying to learn to use jing through JARV interface and I have read JARV User's Guide (http://iso-relax.sourceforge.net/JARV/JARV.html). I have downloaded jingjarv-examples.zip from JARV...
1
by: Roger | last post by:
I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this code, trying to get a list of all defined websites, and write their name to console, but it does not seem to work, would...
3
by: Pol Bawin | last post by:
A class has a private field of type IWizard (An interface) and a public property to access it. When I try to serialize the Geometry class in XML, i have an error but it works in Binary Can...
8
by: hex | last post by:
Hi I make a class "MyClass" and this clas implements the Interface ICloneable. I want when I instance an object from MyClass and I call obj.Clone() it returns an object of MyClass type. for...
5
by: Eric Goforth | last post by:
Hello, I have a generic subroutine that I pass an object and fieldname as arguments. The subroutine then uses reflection to search for the value of the fieldname. For example: 'Calling...
1
by: Kevin S. Goff | last post by:
Hi, all, Hopefully this will make sense: I have 2 classes that implement the same generic interface. public interface IAgingReport<T> { T GetAgingReport(DateTime dAsOfDate); }
3
by: stephen.nil | last post by:
http://code.google.com/p/spxml/ http://spxml.googlecode.com/files/spxml-0.1.src.tar.gz Simple Plain Xml Parser (spxml) is a simple and plain stream-oriented XML parser that supports pull-model and...
0
by: Avi | last post by:
Hello, I am trying to generate a TOC using FOP. I have a XML file as follows: <?xml version="1.0" encoding="iso-8859-1"?> <FILE> <INTERFACE> <NAMEA_B </NAME> <MESSAGEMSG_1 </MESSAGE>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.