Re: [Zope] Sending XML straight down to a zope

2006-10-13 Thread Paul Winkler
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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Sending XML straight down to a zope

2006-10-12 Thread Chris Withers

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

My guess is you should be encoding this as a posted file (ie: as if 
you'd used an input type=file/) and then process the file on the 
server...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Sending XML straight down to a zope

2006-10-12 Thread Peter Bengtsson



Chris Withers wrote:

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


Perhaps I got my pseudo syntax code wrong.
My point is still valid since Zope doesn't seem to be able to 
deconstruct a HTTP POST where a value is send without a key.


My guess is you should be encoding this as a posted file (ie: as if 
you'd used an input type=file/) and then process the file on the 
server...
I've tried to make them change their mind now about how they post it to 
me but it's a bit unclear still if they can change their minds about how 
the XML poster works.

So you don't know of a way to get the value of the posted body in zope?

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Sending XML straight down to a zope

2006-10-12 Thread Dieter Maurer
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).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )