[Zope] xmlrpc problem

Andy Dawkins andyd@nipltd.com
Fri, 9 Jun 2000 13:20:49 +0100


Hi

I am having a small probelm with xmlrpc.  I am simply trying to create a new
object within Zope.  For now the object will be a DTMLDocument.

I have a DTML Method with the id of createDocument and it reads:

<dtml-call "manage_addDTMLDocument('new_document','New Doc',contents)">
Done

I also have a xmlrpc python module that reads:

import xmlrpclib
s=xmlrpclib.Server("http://www.myserver.com/Zope/test/")
args={}
args=['contents']="This is the contents of the new file"
s.createDocument(args)

The traceback I get reads:

Traceback (innermost last):
	File "<stdin>" line 1, in ?
	File "xmlrpclib.py", line 550, in __call__
		return self.__send(self.__name, args)
	File "xmlrpclib.py", line 643, in __request
		request
	File "xmlrpclib.py", line 595, in request
		headers
xmlrpclib.ProtocolError: <Protocol Error for www.myserver.com/Zope/test/:
401 Unauthorized>

If i change createDocument to read:

<dtml-call "manage_addDTMLDocument('new_document','New Doc')">
Done

and change the python module to read:

import xmlrpclib
s=xmlrpclib.Server("http://www.myserver.com/Zope/test/")
s.createDocument()

Then it successfully creates the document.

So how do I successfully pass arguments in to the DTML method so that it can
populate the new document with the correct data?

Cheers
-Andy Dawkins
(New Information Paradigms Ltd)