[Zope] XML-RPC woes
Phil Harris
phil.harris@zope.co.uk
Fri, 11 Feb 2000 14:44:01 -0000
Tone,
Is the page 'really' blank, have a look at the source.
It maybe that the Python Method is returning a reference to an object, which
would look something like
<blah blah blah>
Which of course wouldn't get rendered by the browser.
HTH
Phil
phil.harris@zope.co.uk
| -----Original Message-----
| From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tony
| McDonald
| Sent: Friday, February 11, 2000 1:40 PM
| To: Zope List
| Subject: [Zope] XML-RPC woes
|
|
| Hi all,
| I'm trying to get this to work **from a XXX PythonMethod** (ie the
| ones that allow you to import things and are coloured red and orange!)
|
| PythonMethod do_par
|
| import xmlrpclib
|
| server_url="http://xmlrpc.server:9999"
| server=xmlrpclib.Server(server_url)
| server.getTranscript(number)
|
| I call it with a dtml doc
|
| <form action="do_par" method=post>
| <input type=text name="number:int">
| </form>
|
| The PythonMethod returns a blank page (whether from the form or
| the 'try' tab)
|
| If I make the PythonMethod be;
| import xmlrpclib
|
| def doit(number):
| server_url="http://xmlrpc.server:9999"
| server=xmlrpclib.Server(server_url)
| return server.getTranscript(number)
|
| doit(number)
|
| Then I get this error, when called from either the form or the 'try' tab.
| <!--
| Error type: NameError
| Error value: xmlrpclib
| -->
| <!--
| Traceback (innermost last):
| File /home/nnle/MEDFAC_SERVER/lib/python/ZPublisher/Publish.py,
| line 214, in publish_module
| File /home/nnle/MEDFAC_SERVER/lib/python/ZPublisher/Publish.py,
| line 179, in publish
| File /home/nnle/MEDFAC_SERVER/lib/python/Zope/__init__.py, line
| 202, in zpublisher_exception_hook
| (Object: ElementWithAttributes)
| File /home/nnle/MEDFAC_SERVER/lib/python/ZPublisher/Publish.py,
| line 165, in publish
| File /home/nnle/MEDFAC_SERVER/lib/python/ZPublisher/mapply.py, line
| 160, in mapply
| (Object: do_par)
| File /home/nnle/MEDFAC_SERVER/lib/python/ZPublisher/Publish.py,
| line 102, in call_object
| (Object: do_par)
| File
| /home/nnle/MEDFAC_SERVER/lib/python/Products/PythonMethod/PythonMethod
| .py, line 168, in __call__
| (Object: do_par)
| (Info: (('961160610',), {}, None))
| File <string>, line 9, in do_par
| File <string>, line 6, in doit
| NameError: (see above)
|
| -->
|
| I'd like to work from PythonMethods as they offer the promise of
| speedy editing, so what am I doing wrong this time? :(
|
| getTranscript does work, because all this code works from the Python
| interpreter.
|
| ta
| tone.
| ------
| Dr Tony McDonald, FMCC, Networked Learning Environments Project
| http://nle.ncl.ac.uk/
| The Medical School, Newcastle University Tel: +44 191 222 5888
| Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
|
| _______________________________________________
| 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 )
|