[Tutor] Best way to POST XML to CGI

Ertl, John C CIV 63134 john.ertl at navy.mil
Thu Jun 7 20:55:15 CEST 2007


Alan,
 
Thanks for the input.  I am trying to make something that is capable of being a bit more B2B than a standard HTML form...but be able to have a friendly interface for a person.  I have not liked SOAP in the past...way to much extra stuff.  I was trying to think REST but I have to admit I am missing some pieces.  Maybe XML/RPC.
 
Thanks again for the advice...I will rethink how I am doing this.
 
John Ertl
Meteorologist
 
FNMOC
7 Grace Hopper Ave.
Monterey, CA 93943
(831) 656-5704
john.ertl at navy.mil

________________________________

From: tutor-bounces at python.org on behalf of Alan Gauld
Sent: Thu 6/7/2007 9:30 AM
To: tutor at python.org
Subject: Re: [Tutor] Best way to POST XML to CGI



"Ertl, John C CIV 63134" <john.ertl at navy.mil> wrote

> I have a Python program that makes images of data
> and I want to be able to make these via a web interface. 

Fair enough.

> I want to keep it simple so I thought I would send
> an XML file to a cgi program

But thats not simple. CGI is not really designed to deal with XML,
they are almost complementary technologies. CGI sends
name/value pairs either in GET or POST format. XML encodes
the values into a text file. Different things. XML tends to be used
for RPC or B2B type applications, CGI is typically used for basic
form submissions.

Sure you can do it, but I'm not sure there is much point!
I'd probably look to use CGI to capture the details then
create the XML file at the server end. Its a lot more efficient
in terms of network bandwidth too. XML is about the most
inefficient network "protocol" ever invented.

> I have an HTML form that I use to collect input on what
> kind of image.   I then take that form input and make it
> into an XML string.  I then take that XML string and POST
> it to a CGI script.

As I say, a pretty complex process compared to a simple
CGI submit action.

> I bet Python has a simple way to receive a XML post
> so I do not have to look for a specific form name?

Python offers many ways to deal with XML file transmissions,
including XML/RPC and SOAP. But CGI is probably not the
best approach for XML IMHO. It can be done in the same way
as posting a normal text file but its pretty much turning an
easy job into a hard one for no benefit.

Alan G.

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070607/be233925/attachment.htm 


More information about the Tutor mailing list