<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Ok, but this is not exactly what I want. <br>
<br>
I want to publish to resources using my web server and both must be
accesibles from differents urls, for example:<br>
<br>
<a class="moz-txt-link-freetext" href="http://localhost:8000/uploadHandler">http://localhost:8000/uploadHandler</a> => Handle the HTTP POST from a
form<br>
<a class="moz-txt-link-freetext" href="http://localhost:8000/xmlrpc_converter">http://localhost:8000/xmlrpc_converter</a> => Is a XML-RPC resource
accesible from a xml-rpc client<br>
<br>
<br>
Jaime Wyant escribió:
<blockquote
cite="midd52c72d20707060531x4b9bade8g3573700a36e93e7b@mail.gmail.com"
type="cite">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 ->
<br>
<br>
'/xmlrpc_converter': MyConverterXMLRPCClass().xmlrpc_mymethod1<br>
<br>
^^ Should get you past the __call__ error you're getting.<br>
<br>
HTH!<br>
jw<br>
<br>
<div><span class="gmail_quote">On 7/6/07, <b class="gmail_sendername">
Daniel de la Cuesta</b> <<a href="mailto:daniel.cuesta@iavante.es">daniel.cuesta@iavante.es</a>>
wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div 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>
<br>
pages = { '/' : loginPage, <br>
'/uploadHandler' : handleUpload,<br>
'/uploadform' : uploadForm,<br>
'/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>
<br>
def __init(self):<br>
""""""<br>
pass<br>
<br>
def xmlrpc_mymethod1(self, param)<br>
"""My process""<br>
<br>
But It down't work, when I try <a
href="http://localhost:8000/xmlrpc_converter" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">http://localhost:8000/xmlrpc_converter</a>
I
get the following error:<br>
<br>
"MyConverterXMLRPCClass instance has no __call__ method"<br>
<br>
How can I call MyConverterXMLRPCClass from an url in my http server?<br>
<br>
Thank you.<br>
<br>
<br>
<br>
<div>-- <br>
<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é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ÓN IAVANTE</font></span>
<br>
<span lang="es"><font color="#339966" face="RotisSemiSans"><a
href="mailto:daniel.cuesta@iavantefundacion.com" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">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ó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.</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>
</div>
<br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com
</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)"
href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python"
target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
<br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
"Government does not solve problems; it subsidizes them."<br>
Ronald Reagan
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Twisted-Python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a>
<a class="moz-txt-link-freetext" href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a>
</pre>
</blockquote>
<br>
<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é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Ó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ó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.</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>