[Zope] xmlrpc and zope objects

Derek Basch dbasch@yahoo.com
Thu, 9 May 2002 12:58:26 -0700 (PDT)


Thank you for the reply Julián_Muñoz,

I meant to say DTML Document in my first posting. I
have since fixed this problem and it seems to work
now. 

However, I am having a very hard time figuring out how
to use the Zope API functions via the xmlrpclib
module. There is very little documentation and fewer
examples. I have managed to make a few API functions
work though most still return errors. I have read in
various white papers that most of the API should work
via xml-rpc.

Does anyone have some examples they could share?

Has anyone else ran into these issues?

Here is a code snippet that works for me:

import xmlrpclib
s=xmlrpclib.Server('http://localhost:8080/',xmlrpclib.BasicAuthTransport('administrator','zopeisfun'))
print s

id ='testfolder'
title = 'testfoldertitle'
s.manage_addFolder(id, title)

are their any alternative/better ways of doing this?

Thanks,
Derek Basch

> Uhm, try with to call a python method.
> I don't know if it is possible to call a dtml
> object. You should give him
> the parameters it expects. ???> 
> 
> On Sun, 5 May 2002, Derek Basch wrote:
> 
> > Hi,
> > Please help me zope gods.........
> >
> > I have been trying to use/learn xmlrpclib with
> zope
> > using this example:> >
> >
> http://www.xml.com/pub/a/2000/01/xmlrpc/index2.html
> >
> > I followed the example and I was able to read the
> > document_src of the 'Test' DTML Method after I
> > repaired the modified xmlrpclib file:> >
> >
> http://www.zope.org/Members/teyc/pipermailXMLRPCWoes
> >
> > However, I cant do it again!?. If I connect to the
> > zope server as such:
> >
> > import xmlrpclib
> > z = xmlrpclib.Server('http://localhost:8080/Test',
> >
>
xmlrpclib.BasicAuthTransport('administrator','password'))
> >
> > and attempt to view the document_src method of
> 'Test'
> > I get a 'resource not found' error. I know the
> object
> > exists because the URL of
> http://localhost:8080/Test
> > returns the DTML document in my browser and also
> the
> > error returned in my python interpreter has the
> title
> > of the DTML document. What am I doing wrong here?


__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Mother's Day is May 12th!
http://shopping.yahoo.com