<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I have a twisted web server running using "twisted.web.http".<br>
<br>
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.<br>
<br>
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.<br>
<br>
This is my pages dispatch:<br>
<br>
class MyRequestHandler(http.Request):<br>
<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; pages = { '/' : loginPage, <br>
&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '/uploadHandler' : handleUpload,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '/uploadform' : uploadForm,<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '/xmlrpc_converter': MyConverterXMLRPCClass() }<br>
<br>
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).<br>
<br>
I have tried to implement MyConverterXMLRPCClass() as follows:<br>
<br>
MyConverterXMLRPCClass(xmlrpc.XMLRPC):<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; def __init(self):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """"""<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass<br>
<br>
&nbsp;&nbsp;&nbsp; def xmlrpc_mymethod1(self, param)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """My process""<br>
<br>
But It down't work, when I try <a class="moz-txt-link-freetext" href="http://localhost:8000/xmlrpc_converter">http://localhost:8000/xmlrpc_converter</a> I
get the following error:<br>
<br>
"MyConverterXMLRPCClass instance has no __call__ method"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
How can I call MyConverterXMLRPCClass from an url in my http server?<br>
<br>
Thank you.<br>
&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
<div class="moz-signature">-- <br>
<title></title>
<p align="left"><span lang="es"><b><font color="#808080"
 face="RotisSemiSans">Daniel de la Cuesta Navarrete</font></b></span> <br>
<span lang="es"><b><font color="#808080" face="RotisSemiSans">T&eacute;cnico
de Desarrollo de Software</font></b></span></p>
<p align="left"><span lang="es"></span><span lang="es"><font
 color="#339966" face="IAVANTE" size="4">FUNDACI&Oacute;N IAVANTE</font></span>
<br>
<span lang="es"><font color="#339966" face="RotisSemiSans"><a class="moz-txt-link-abbreviated" href="mailto:daniel.cuesta@iavantefundacion.com">daniel.cuesta@iavantefundacion.com</a></font></span>
<br>
<span lang="es"><font color="#339966" face="RotisSemiSans">Tel. 951 015
300</font></span> </p>
<br>
<p align="center"><span lang="es"><font color="#999999" face="Verdana"
 size="1">Este correo electr&oacute;nico y, en su caso, cualquier fichero
anexo, contiene informaci&oacute;n confidencial exclusivamente dirigida a
su(s) destinatario(s). Toda copia o divulgaci&oacute;n deber&aacute; ser autorizada
por IAVANTE.</font></span></p>
<p align="center"><span lang="en-gb"><font color="#999999"
 face="Verdana" size="1">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.</font></span></p>
<br>
</div>
</body>
</html>