commit e4b27b56b9b8be1998e4160ab269fcd628c3c704 Author: Dan Dembinski Date: Mon Jun 3 20:49:43 2019 -0400 Initial commit diff --git a/XMLTesting.py b/XMLTesting.py new file mode 100644 index 0000000..3b0b91e --- /dev/null +++ b/XMLTesting.py @@ -0,0 +1,37 @@ +from lxml import etree + +# envelope = etree.XML('') +body = etree.Element("soap12") +GetReport = etree.SubElement(body, "GetReport") +reportName = etree.SubElement(body, "Orders") + + +print(body.tag) + + + + +# +# +# +# +# 40fb3d62-abfd-4476-b99f-75035aa1c0da +# Orders +# +# Order ID +# Order Price +# +# +# +# + + + + + + + +866c9811-f51d-4910-adb7-6321ec7f19ea + + + diff --git a/main.py b/main.py new file mode 100644 index 0000000..1a7ef9e --- /dev/null +++ b/main.py @@ -0,0 +1,67 @@ +import requests +from lxml import etree + +from io import StringIO, BytesIO + +ticket = '40fb3d62-abfd-4476-b99f-75035aa1c0d' + +test = """ + + + + """+ticket+""" + Orders + + Order ID + Order Price + + + +""" +send = """ + + + + 40fb3d62-abfd-4476-b99f-75035aa1c0da + Orders + + Order ID + Order Price + + + +""" + +ObtainTicket = """ + + + + ddembinski + mond@y + string + + +""" + +ReleaseTicket = """ + + + + fca51a05-d821-454c-9e5f-9aa19c94cf6f + + +""" + +headers = {'Host': 'soprema.gli.us.com', 'Content-Type': 'application/soap+xml; charset=utf-8', 'Content-Length': 'length'} + +namespaces = { + 'soap': 'http://www.w3.org/2003/05/soap-envelope', + 'a': 'http://www.pageflex.com/XmlWebServices/2004/StorefrontAPI/20041111' +} + + +response = requests.post('http://soprema.gli.us.com/Store/storefrontapi.asmx', data=ObtainTicket, headers=headers).text + +print(response) +xml = bytes(bytearray(response, encoding='utf-8')) +doc = etree.XML(xml)