有人合并了吗肥皂.py或者用Python泡泡?

2024-05-18 17:43:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我想替换一个应用程序当前基于cURL的(严重损坏和粗糙的)(cURL命令行的!)肥皂水客户端或肥皂.py. 问题是,我们必须联系MS CRM服务,因此必须使用NTLM。由于各种原因,使用NTLM代理有点麻烦,所以我正在研究python-ntlm来提供这种支持。在

罐装肥皂水或肥皂.py是否使用此身份验证方法?如果是,怎么办?如果没有,任何其他的建议都会很棒。在

编辑

如下所述,suds已经支持pythontlm开箱即用。在


Tags: 命令行py身份验证应用程序客户端代理原因curl
3条回答

您可以将CNTLM用作本地代理服务,该服务将处理所有NTLM身份验证调用。然后您只需使用soapy或urllib2引用本地CNTLM代理IP和端口而不进行身份验证。。。不管怎样。在

我还没有找到一个能够很好地处理复杂代理的python库。在

从0.3.8开始,Suds是fixed来支持它的。在

python-suds-0.3.9\suds\transport的源代码\https.py说:

class WindowsHttpAuthenticated(HttpAuthenticated):
    """
    Provides Windows (NTLM) http authentication.
    @ivar pm: The password manager.
    @ivar handler: The authentication handler.
    """

    def u2handlers(self):
        # try to import ntlm support  
        try:
            from ntlm import HTTPNtlmAuthHandler
        except ImportError:
            raise Exception("Cannot import python-ntlm module")
        handlers = HttpTransport.u2handlers(self)
        handlers.append(HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(self.pm))
        return handlers

请按here所述使用以下代码段:

^{pr2}$

另一种方法是在soap异常期间调用curl命令,然后启动重试。在

像是。。。在

curl -x websenseproxy:8080  ntlm -U domain\user:password  insecure https://blah.com/prod/webservice.asmx?WSDL

#insecure用于自签名证书

相关问题 更多 >

    热门问题