[Twisted-Python] XMLRPC Class in HTTP Server.
Jaime Wyant
programmer.py at gmail.com
Fri Jul 6 06:31:18 MDT 2007
I'm not sure how the twisted web server works (I'm a new guy around here!),
but it looks like your dictionary, pages, maps url's to callables. But
MyConverterXMLRPCClass() is an instance, that is not callable (no __call__
method). I think what you want to do is something like this ->
'/xmlrpc_converter': MyConverterXMLRPCClass().xmlrpc_mymethod1
^^ Should get you past the __call__ error you're getting.
HTH!
jw
On 7/6/07, Daniel de la Cuesta <daniel.cuesta at iavante.es> wrote:
>
> Hi,
>
> I have a twisted web server running using "twisted.web.http".
>
> The objective of the server is to convert files to another format.
> Currently I upload the files and the conversion params using an HTTP POST
> from a form.
>
> Now I want to add XML-RPC support to the conversion process. It means the
> user could process the conversion using the http form or calling directly
> the XML-RPC class.
>
> This is my pages dispatch:
>
> class MyRequestHandler(http.Request):
>
>
> pages = { '/' : loginPage,
> '/uploadHandler' : handleUpload,
> '/uploadform' : uploadForm,
> '/xmlrpc_converter': MyConverterXMLRPCClass() }
>
> What I want to do is offer the user two possibilities to upload the file,
> one of them using HTTP POST (calling to "uploadform") and the other using
> XML-RPC (caling to xmlrpc_converter).
>
> I have tried to implement MyConverterXMLRPCClass() as follows:
>
> MyConverterXMLRPCClass(xmlrpc.XMLRPC):
>
> def __init(self):
> """"""
> pass
>
> def xmlrpc_mymethod1(self, param)
> """My process""
>
> But It down't work, when I try http://localhost:8000/xmlrpc_converter I
> get the following error:
>
> "MyConverterXMLRPCClass instance has no __call__ method"
>
> How can I call MyConverterXMLRPCClass from an url in my http server?
>
> Thank you.
>
>
>
> --
>
> *Daniel de la Cuesta Navarrete*
> *Técnico de Desarrollo de Software*
>
> FUNDACIÓN IAVANTE
> daniel.cuesta at iavantefundacion.com
> Tel. 951 015 300
>
> Este correo electrónico y, en su caso, cualquier fichero anexo, contiene
> información confidencial exclusivamente dirigida a su(s) destinatario(s).
> Toda copia o divulgación deberá ser autorizada por IAVANTE.
>
> This e-mail and any attachments are confidential and exclusively directed
> to its adressee(s). Any copy or distribution will have to be authorized by
> IAVANTE.
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
--
"Government does not solve problems; it subsidizes them."
Ronald Reagan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20070706/330e1cc4/attachment.html>
More information about the Twisted-Python
mailing list