[Zope] xml rpc

Hannu Krosing hannu at tm.ee
Sat Dec 6 08:46:28 EST 2003


Pieter Laeremans kirjutas L, 06.12.2003 kell 15:14:
> >From the document at http://www.zope.org/Members/teyc/howxmlrpc  
> I deduce that zope has the ability to work as an xmlrpc server.
> 
> However when I try it using the following code (because I didn't make
> a test folder and because zope runs on port 9673 on my system)
> 
> --------------------------------------------------------
> #!/usr/bin/python
> 
> import xmlrpclib
> 
> s=xmlrpclib.Server("http://localhost:9673")
> print s.Zope.pyhello("Chui Tey")

Do you have an one argument methiod called Zope/pyhello defined in your
zope ?

> ---------------------------------------------------------
> 
> I get the following error:
> 
> 
> ---------------------------------------------------------
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/tmp/python-1067nTO.py", line 8, in ?
>     print s.Zope.pyhello("Chui Tey")
>   File "/usr/lib/python2.3/xmlrpclib.py", line 1029, in __call__
>     return self.__send(self.__name, args)
>   File "/usr/lib/python2.3/xmlrpclib.py", line 1316, in __request
>     verbose=self.__verbose
>   File "/usr/lib/python2.3/xmlrpclib.py", line 1080, in request
>     return self._parse_response(h.getfile(), sock)
>   File "/usr/lib/python2.3/xmlrpclib.py", line 1219, in _parse_response
>     return u.close()
>   File "/usr/lib/python2.3/xmlrpclib.py", line 742, in close
>     raise Fault(**self._stack[0])
> xmlrpclib.Fault: <Fault -2: 'Unexpected Zope error value: NotFound -  \n \n\n \n \n \n\n \n   Site Error \n   An error was encountered while publishing this resource.\n   \n    Resource not found  \n\n  Sorry, the requested resource does not exist. Check the URL and try again.   Resource:  RPC2\nPOST \n   \n\n   Troubleshooting Suggestions \n\n   \n   The URL may be incorrect. \n   The parameters passed to this resource may be incorrect. \n   A resource that this resource relies on may be\n      encountering an error. \n   \n\n   For more detailed information about the error, please\n  refer to the error log.\n   \n\n   If the error persists please contact the site maintainer.\n  Thank you for your patience.\n   \n  \n '>
> 
> ----------------------------------------------------------------------
> 
> Does this mean that zope doesn't support xmlrpc ?  

Yo did get back bona fide XML RPC fault, so obviously Zope does support
XML-RPC

> I have zope version 2.6.2.
> 
> Am I doing something wrong ?

Probably

> Any tips ?

Check the logs (under Zope's var/ directory) to see what your library
tries to access.

Read docs for xmlrpclib ;)

---------------
Hannu




More information about the Zope mailing list