有人将soap.py 或suds 与python-ntlm 结合起来吗?
我想用 suds 或soap.py 替换应用程序当前(严重损坏且粗劣)基于 cURL(基于 cURL 命令行!)的 SOAP 客户端。问题是,我们必须联系 MS CRM 服务,因此必须使用 NTLM。由于多种原因,NTLM 代理使用起来有点麻烦,所以我正在研究 python-ntlm 来提供这种支持。
可以让 suds 或soap.py 使用这种身份验证方法吗?如果是这样,怎么办?如果没有,任何其他建议都会很棒。
编辑
如下所述,suds 已经支持开箱即用的 python-ntlm。
I'd like to replace an app's current (badly busted and crufty) cURL-based (cURL command-line based!) SOAP client with suds or soap.py. Trouble is, we have to contact an MS CRM service, and therefore must use NTLM. For a variety of reasons the NTLM proxy is a bit of a pain to use, so I'm looking into python-ntlm to provide that support.
Can suds or soap.py be made to use this authentication method? If so, how? If not, any other suggestions would be fantastic.
Edit
As noted below, suds already supports python-ntlm out of the box.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Suds 自 0.3.8 起已修复以支持它。
python-suds-0.3.9\suds\transport\https.py 的来源说:
尝试使用以下代码段,如所述 此处:
Suds was fixed to support it since 0.3.8.
Sources of python-suds-0.3.9\suds\transport\https.py says:
Try with the following snippet as described here:
另一种方法是在肥皂异常期间调用curl命令,然后启动重试。
类似...
#insecure
用于自签名证书Another approach would be to call your curl command during soap exceptions and then initiate a retry.
something like...
#insecure
is used for self signed certs您可以使用 CNTLM 作为本地代理服务,它将处理所有 NTLM 身份验证调用。然后,您只需引用本地 CNTLM 代理 IP 和端口,无需使用soapy 或 urllib2 进行身份验证...无论什么。
我还没有找到一个可以很好地处理复杂代理的 python 库。
You can use CNTLM as a local proxy service which will handle all the NTLM authentication calls. Then you just reference the local CNTLM proxy IP and port with no authentication using soapy or urllib2... whatever really.
I've yet to find a python library that deals with complex proxies well.