Skip to content

Instantly share code, notes, and snippets.

@isidroamv
Created October 30, 2017 04:34
Show Gist options
  • Save isidroamv/2bf2b2c6ebb53e0ad667024cd30cadc8 to your computer and use it in GitHub Desktop.
Save isidroamv/2bf2b2c6ebb53e0ad667024cd30cadc8 to your computer and use it in GitHub Desktop.
Make a SOAP Authentication with UsernameToken using python
from zeep import Client
from zeep.transports import Transport
from zeep.wsse.username import UsernameToken
import json
url = "https://example.com/Service.svc?wsdl"
client = Client(url, wsse=UsernameToken("username", "password"))
reponse = client.service.MyService(request={"CountryCode": "MEX", "ClientCode": 0000})
print("reponse", reponse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment