<div dir="ltr">Thanks for ur help. But now i am getting an error <br><br><span style="color: rgb(255, 102, 102);">xmlrpclib.ProtocolError: &lt;ProtocolError for localhost:8000/RPC2: 500 Internal Server Error&gt;<br><br><br>

</span>Here is my code at <a href="http://privatepaste.com/d81Kut9AFj" target="_blank">http://privatepaste.com/d81Kut9AFj</a><br><br>Any idea what wrong am i doing?<br><br><div class="gmail_quote">On Thu, Sep 11, 2008 at 7:18 AM, Fredrik Lundh <span dir="ltr">&lt;<a href="mailto:fredrik@pythonware.com">fredrik@pythonware.com</a>&gt;</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;">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;"><div class="Ih2E3d">
And i also fount that a typical system.auth call will look like:<br>
<br>
POST /xmlrpc/clarens_server.py HTTP/1.0<br>
Host: localhost<br></div>
User-Agent: xmlrpclib.py/0.9.9 (by <a href="http://www.pythonware.com" target="_blank">www.pythonware.com</a> &lt;<a href="http://www.pythonware.com" target="_blank">http://www.pythonware.com</a>&gt;)<div class="Ih2E3d">
<br>
<br>
Content-Type: text/xml<br>
Content-Length: 105<br>
AUTHORIZATION: Basic MkhVTm9VazYxbXArVEZLS0dCY2tIRlA3bjVzPQo6RnJvbSBi<br>
&lt;?xml version=&#39;1.0&#39;?&gt;<br>
&lt;methodCall&gt;<br>
 &nbsp;&lt;methodName&gt;system.auth&lt;/methodName&gt;<br>
<br>
 &nbsp;&lt;params&gt;<br>
 &nbsp;&lt;/params&gt;<br>
&lt;/methodCall&gt;<br>
<br>
<br>
Problem is that i don&#39;t know how do i generate above xml system.auth call. Can anyone please tell me how do call a function, setting the header of the call too?<br>
</div></blockquote>
<br>
you need to plugin a custom transport. &nbsp;see this page for an example:<br>
<br>
 &nbsp; &nbsp;<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>
in your case, it should be sufficient to override send_request, e.g. (untested):<br>
<br>
 &nbsp; &nbsp;class SecureTransport(xmlrpclib.Transport):<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;def set_authorization(self, ustring, text_ucert):<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.authoriation = encodestring(<div class="Ih2E3d"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;%s:%s&quot; % (ustring,text_ucert)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br>
<br></div>
 &nbsp; &nbsp; &nbsp; &nbsp;def send_request(self, connection, handler, request_body):<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;connection.putrequest(&quot;POST&quot;, handler)<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;connection.putheader(&quot;Authorization&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Basic %s&quot; % self.authorization<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)<br>
<br>
and instantiate the transport by doing<br>
<br>
 &nbsp; &nbsp;t = SecureTransport()<br>
 &nbsp; &nbsp;t.set_authorization(ustring, text_ucert)<br>
<br>
before passing to the server proxy.<br>
<br>
&lt;/F&gt;<br><font color="#888888">
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br></div>