[Zope] Sending XML straight down to a zope

Paul Winkler pw_lists at slinkp.com
Thu Oct 12 22:43:25 EDT 2006


On Thu, Oct 12, 2006 at 09:16:30PM +0200, Dieter Maurer wrote:
> Chris Withers wrote at 2006-10-12 08:35 +0100:
> >Peter Bengtsson wrote:
> >> xml_content = open('validxmlfile.xml').read()
> >> http = httplib.HTTP("localhost", 8080)
> >> http.putrequest("POST", "/uploadExpenseXML")
> >
> >That's not really a valid transaction...
> 
> Why not?
> 
> 
> The real problem is that Zope wrongfully assumes that each
> "POST" with content type "text/xml" is an XML-RPC request.
> 
> That's wrong at least since XML is more widely used on the browser
> side (e.g. XForms).

XML-RPC is not very helpful here.  As usual, its extreme simplicity is
both a blessing and a curse.
The specification, http://www.xmlrpc.com/spec , specifies POST with
content-type of text/xml, and that's all; so you really can't
distinguish XML-RPC from any other xml POST just from the header.

I suppose the publisher could cheat a bit and look in the body for the
required <methodCall> element.  If missing, it can't be XML-RPC.

It would be more reliable if some configuration was required to specify
when XMLRPC is expected, and when not. But that would break Zope's
longstanding promise that XMLRPC is supported "for free", always,
automatically.

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list