[Python] suds is not using HTTPS, even though the URL is set correctly

Discussão em 'Python' iniciado por Stack, Abril 14, 2025.

  1. Stack

    Stack Membro Participativo

    Consider this code:

    from suds.client import Client

    wsdl = "https://path/to/scv?wsdl"
    client = Client(wsdl)

    token = client.factory.create("ns1:AuthenticationToken")
    token.LoginName = "login"
    token.UserId = "userid"
    token.Password = "password"

    client.set_options(soapheaders=token)

    articleno = "articleno"

    list = client.factory.create("ns1:ArticlesList")
    list.Article.append(articleno)
    result = client.service.GetStockLevel(list)


    When inspecting the stream, I see it uses HTTP instead of HTTPS, causing an error because the endpoint gives a HTTP301 on that. Even though I start my url with https://.

    Is there a way to force suds to use HTTPS?

    Continue reading...

Compartilhe esta Página