<div dir="ltr">I'm using suds-jurko [1] with soap_wsse [2] for this. It is simple. I never tried pysimplesoap.<div><br></div><div><div><font face="monospace, monospace">from soap_wsse.suds_plugin import WssePlugin</font></div><div><font face="monospace, monospace">from suds.client import Client</font></div><div><font face="monospace, monospace">from suds.wsse import Security, UsernameToken, Timestamp</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">url = "<a href="http://example.com/service?WSDL" target="_blank">http://example.com/service?WSDL</a>"</font></div><div><font face="monospace, monospace">username = "test"</font></div><div><font face="monospace, monospace">password = "p@ssw0rd!"</font></div><div><font face="monospace, monospace">certificate = "/your/cert.pem"</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">s = Security()</font></div><div><font face="monospace, monospace">s.tokens.extend([UsernameToken(username, password), Timestamp()])</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">client = Client(url, plugins=[WssePlugin(certificate)])</font></div><div><font face="monospace, monospace">client.set_options(wsse=s)</font></div></div><div><br></div><div><div>[1] <a href="https://pypi.python.org/pypi/suds-jurko" target="_blank">https://pypi.python.org/pypi/suds-jurko</a></div><div>[2] <a href="https://pypi.python.org/pypi/soap_wsse" target="_blank">https://pypi.python.org/pypi/soap_wsse</a></div></div><div><br></div><div class="gmail_extra">Cheers!</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 27, 2015 at 12:06 PM, Paul Tomblin <span dir="ltr"><<a href="mailto:ptomblin@xcski.com" target="_blank">ptomblin@xcski.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I need to talk to a web service that requires wsse:BinarySecurityToken, ds:Security, wsse:UsernameToken and wsu:Timestamp headers. I see that the latest version of pysimplesoap on <a href="http://python.org" target="_blank">python.org</a> has some sort of plugin architecture and a wsse.py for at least some of these headers, but I don't see any documentation on how to use them. The Google Code page doesn't have the wsse.py file, and so obviously nothing in their Wiki.<div><br></div><div>Can somebody point me to documentation or examples?</div><span><font color="#888888"><div><br clear="all"><div><br></div>-- <br><div><a href="http://www.linkedin.com/in/paultomblin" target="_blank">http://www.linkedin.com/in/paultomblin</a><br><a href="http://careers.stackoverflow.com/ptomblin" target="_blank">http://careers.stackoverflow.com/ptomblin</a><br></div>
</div></font></span></div>
<br>_______________________________________________<br>
Soap mailing list<br>
<a href="mailto:Soap@python.org" target="_blank">Soap@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/soap" target="_blank">https://mail.python.org/mailman/listinfo/soap</a><br>
<br></blockquote></div><br></div></div>