[Zope] Syntax error in XML-RPC How to?
Michel Pelletier
michel@digicool.com
Thu, 09 Mar 2000 12:56:42 -0800
What's the traceback embedded in the HTML source of the error page?
It will point you directly to where the syntax error is.
-Michel
Andrew Diller wrote:
>
> hi: I'm trying to use the BasicAuth example in the "XML-RPC How To"
>
> http://www.zope.org/Members/Amos/XML-RPC
>
> I keep getting the Zope error when creaing the External Method:
>
> Zope has encountered an error while publishing this resource.
>
> Error Type: SyntaxError
> Error Value: invalid syntax
>
> --------
>
> I've just cut and pasted this from the webpage, only removed extra padding spaces, and spliced the one big
> line back together:
> h.putheader("AUTHORIZATION", "Basic %s" % string.replace(encodestring("%s:%s" % (self.username,
> self.password)),"\012", ""))
>
> The code defines a class and a def:
>
> ---------------
> class BasicAuthTransport(xmlrpclib.Transport):
> def __init__(self, username=xxxx, password=xxxx):
> self.username=username
> self.password=password
>
> def request(self, host, handler, request_body):
> # issue XML-RPC request
>
> ----------------
> In the Add External method page, where you enter in the Function name I've tried:
>
> request
> BasicAuthTransport
> BasicAuthTransport.request
> request.BasicAuthTransport
>
> Which is the right one? it want's the Function 'request', right?
>
> So, the syntax error must be something in the script.
>
> Any help would be appreciated.
>
> -andy
>
> _______________________________________________
> 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 )