Last active
October 10, 2019 02:09
-
-
Save cherdt/2e0f5f7d6fa06581d18f807172375715 to your computer and use it in GitHub Desktop.
Example SOAP 1.2 Request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# An example SOAP request | |
# See https://www.dataaccess.com/webservicesserver/NumberConversion.wso | |
# for other operations | |
import requests | |
url = 'https://www.dataaccess.com/webservicesserver/NumberConversion.wso' | |
headers = {'content-type': 'application/soap+xml; charset=utf-8'} | |
# Note that we name the XML namespace soap12 | |
# We could name this anything we want, but it needs be consistent in the tags | |
body = '''<?xml version="1.0" encoding="utf-8"?> | |
<soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> | |
<soap12:Body> | |
<NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/"> | |
<ubiNum>2019</ubiNum> | |
</NumberToWords> | |
</soap12:Body> | |
</soap12:Envelope>''' | |
soap_response = requests.post(url, data=body, headers=headers) | |
print(soap_response.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment