<div dir="ltr">Where exactly should i call ServerProxy? Following is the code from my client.py<br><br><span style="color: rgb(0, 0, 153);">t = SecureTransport()</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);"> </span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);"> t.set_authorization(ustring, text_ucert)</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);"> server = xmlrpclib.Server('<a href="http://localhost:8000/">http://localhost:8000/</a>',transport=t)</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);"> print server.s()<br><br></span>Note: Full code for client is here at <a href="http://privatepaste.com/b56oS1Xa7P">http://privatepaste.com/b56oS1Xa7P</a><br><span style="color: rgb(0, 0, 153);"><br>
<font color="#000000">and following is my server code<br><br><span style="color: rgb(0, 0, 153);">import SimpleXMLRPCServer</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">#server = ServerProxy("<a href="http://betty.userland.com">http://betty.userland.com</a>")</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">class AuthenticationFunctions:</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);"> def s(self):</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);"> print "something..."</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);"> </span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost", 8000))</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">server.register_instance(AuthenticationFunctions())</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">server.serve_forever() </span><br>
</font></span><br><br><div class="gmail_quote">On Sat, Sep 13, 2008 at 8:44 AM, Fredrik Lundh <span dir="ltr"><<a href="mailto:fredrik@pythonware.com">fredrik@pythonware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Usman Ajmal wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Please explain the arguments of send_request. What exactly are the connection, handler and request_body? It will be really helpful if you give an example of how do i call send_request<br>
</blockquote>
<br></div>
you don't call send_request. you should pass the SecureTransport instance as an argument to the ServerProxy, which will then use it to talk to the server. see the "custom transport" example in the library reference that I pointed you to.<div class="Ih2E3d">
<br>
<br>
<a href="http://www.python.org/doc/lib/xmlrpc-client-example.html" target="_blank">http://www.python.org/doc/lib/xmlrpc-client-example.html</a><br>
<br></div><div><div></div><div class="Wj3C7c">
</F><br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br></div>