xmlrpc and zope objects
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? Thanks in advance, Derek Basch __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com
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? Thanks in advance, Derek Basch
__________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- __o _ \<_ (_)/(_) Saludos de Julián EA4ACL -.- Foro Wireless Madrid http://opennetworks.rg3.net
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
Derek The thing with calling Zope (Python?) methods through xml-rpc is that xml-rpc is purely positional in the way it uses parameters, while a lot of Zope (Python?) is a mixture of named and positional. While named parameters are a great thing when you want default values, other times (such as this) they can cause a problem. The only real answer is to discover what the default values are and make sure that all parameters required are passed. The other big problem of course is that xml-rpc has no notion of 'None' or any representation of it. This can cause problems where None is a valid value for a parameter. Just a few thoughts that may be pertinent :) hth Phil ----- Original Message ----- From: "Derek Basch" <dbasch@yahoo.com> To: "Julián_Muñoz" <jmunoz@softhome.net>; <zope@zope.org> Sent: Thursday, May 09, 2002 8:58 PM Subject: Re: [Zope] xmlrpc and zope objects
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('ad ministrator','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
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Fri, 10 May 2002, Phil Harris wrote:
The other big problem of course is that xml-rpc has no notion of 'None' or any representation of it. This can cause problems where None is a valid value for a parameter.
Actually, there's an extension to XML-RPC to support "nil" types; I worked up a patch to xmlrpclib to map None to "nil", if anyone's interested. I submitted it to the xmlrpclib maintainer, but got no response... -- Brian Lalor blalor@ithacabands.org
Yeah, Finding the named parameters is the fun part :{ I have been having more success with it lately though and can now put data in new dtml docs or in FileStorage/ZODB :). Speaking of which, can anyone tell me the practical size limit of the ZODB? For example, could 100,000 small documents be stored and indexed/searched without much trouble? How many records could I store using the BTree package? Is an SQL back-end my best choice for large amounts of small records? I have no background in DB's so any help would be welcome. Thanks. Derek Basch --- Phil Harris <phil@harris-family.info> wrote:
Derek
The thing with calling Zope (Python?) methods through xml-rpc is that xml-rpc is purely positional in the way it uses parameters, while a lot of Zope (Python?) is a mixture of named and positional.
While named parameters are a great thing when you want default values, other times (such as this) they can cause a problem. The only real answer is to discover what the default values are and make sure that all parameters required are passed.
The other big problem of course is that xml-rpc has no notion of 'None' or any representation of it. This can cause problems where None is a valid value for a parameter.
Just a few thoughts that may be pertinent :)
hth
Phil
__________________________________________________ Do You Yahoo!? Yahoo! Shopping - Mother's Day is May 12th! http://shopping.yahoo.com
participants (4)
-
Brian Lalor -
Derek Basch -
Julián Muñoz -
Phil Harris