Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Passin credentials of HTTP Basic AUTH

  • Hello to all members.

    How is the right way to pass credentials for a web service cliente using ZSI Service Proxy.

    I have the following client, and it keeps returning HTTP 401 code:


    from ZSI.ServiceProxy import ServiceProxy
    from ZSI.auth import AUTH
    from ZSI.wstools.Utility import HTTPResponse
    import sys

    username = 'myuser'
    password = 'mypass'
    urlservicio = 'http://server/wsMisConsumos/CryMiContadorSrv.asmx?WSDL'

    cred=(AUTH.httpbasic, username, password )
    print urlservicio

            servicio = ServiceProxy(wsdl=urlservicio, auth=cred,  tracefile=sys.stdout)

    except HTTPResponse, http:
                    print http.status
                    print cred

    Thanks in advance for your attention.