diff --git a/main.py b/main.py
index 1a7ef9e..698e8c1 100644
--- a/main.py
+++ b/main.py
@@ -1,67 +1,64 @@
import requests
from lxml import etree
-from io import StringIO, BytesIO
+def Obtain_Ticket():
+ GetTicket = """
+
+
+
+ ddembinski
+ mond@y
+ string
+
+
+ """
-ticket = '40fb3d62-abfd-4476-b99f-75035aa1c0d'
+ headers = {'Host': 'soprema.gli.us.com', 'Content-Type': 'application/soap+xml; charset=utf-8', 'Content-Length': 'length'}
+ response = requests.post('http://soprema.gli.us.com/Store/storefrontapi.asmx', data=GetTicket, headers=headers).text
+ temp1 = response.split('')
+ temp2 = temp1[1].split('')
+ ticket = temp2[0]
+ # print("got ticket: " + ticket)
+ return ticket
-test = """
-
-
-
- """+ticket+"""
- Orders
-
- Order ID
- Order Price
-
-
-
-"""
-send = """
-
-
-
- 40fb3d62-abfd-4476-b99f-75035aa1c0da
- Orders
-
- Order ID
- Order Price
-
-
-
-"""
+def Release_Ticket(ticket):
+ ReleaseTicket = """
+
+
+
+ """+ticket+""""
+
+
+ """
+ headers = {'Host': 'soprema.gli.us.com', 'Content-Type': 'application/soap+xml; charset=utf-8', 'Content-Length': 'length'}
-ObtainTicket = """
-
-
-
- ddembinski
- mond@y
- string
-
-
-"""
+ response = requests.post('http://soprema.gli.us.com/Store/storefrontapi.asmx', data=ReleaseTicket, headers=headers).text
+ # print("released ticket "+ticket)
-ReleaseTicket = """
-
-
-
- fca51a05-d821-454c-9e5f-9aa19c94cf6f
-
-
-"""
+def Run_Report(ticket):
-headers = {'Host': 'soprema.gli.us.com', 'Content-Type': 'application/soap+xml; charset=utf-8', 'Content-Length': 'length'}
+ send = """
+
+
+
+ """+ticket+"""
+ Orders
+
+ Order ID
+ Order Price
+
+
+
+ """
-namespaces = {
- 'soap': 'http://www.w3.org/2003/05/soap-envelope',
- 'a': 'http://www.pageflex.com/XmlWebServices/2004/StorefrontAPI/20041111'
-}
+ headers = {'Host': 'soprema.gli.us.com', 'Content-Type': 'application/soap+xml; charset=utf-8', 'Content-Length': 'length'}
+ response = requests.post('http://soprema.gli.us.com/Store/storefrontapi.asmx', data=send, headers=headers).text
+ print(response)
+def main():
+ ticket = Obtain_Ticket()
+ Run_Report(ticket)
+ Release_Ticket(ticket)
-response = requests.post('http://soprema.gli.us.com/Store/storefrontapi.asmx', data=ObtainTicket, headers=headers).text
+main()
-print(response)
-xml = bytes(bytearray(response, encoding='utf-8'))
-doc = etree.XML(xml)