#!/usr/bin/env python import httplib import sys SM_TEMPLATE = open(sys.argv[1], 'r') SoapMessage = SM_TEMPLATE.read() #Place the path to your certificate and key in PEM format below CERTFILE = "myCertificate.cer" KEYFILE = "myKey.key" #print KEYFILE #print CERTFILE #The variable below is your host name followed by a colon and then the port your service is on. HOSTNAME = "localhost:8444" #USE THIS FOR HTTPS WITH CLIENT CERTIFICATES #conn = httplib.HTTPSConnection( HOSTNAME, key_file = KEYFILE, cert_file = CERTFILE ) #USE THIS FOR HTTPS WITHOUT CLIENT CERTIFICATES #conn = httplib.HTTPSConnection( HOSTNAME) #USE THIS FOR SIMPLE HTTP TESTING conn = httplib.HTTPConnection(HOSTNAME) #print SoapMessage #construct and send the header #adjust the line below to match your URL, this will be different for the Warrant and Protection Order service you host #The URLs below are just examples and might not match the URLs that you have conn.putrequest('POST', '/WarrantService/WarrantService') #conn.putrequest('POST', '/ProtectionOrderService/ProtectionOrderService') conn.putheader("Content-type", "text/xml; charset=\"UTF-8\"") conn.putheader("Content-length", "%d" % len(SoapMessage)) #Sometimes you will have to comment out the soap action below... #SOAP Action for a warrant conn.putheader("SOAPAction", "http://wijis.wisconsin.gov/services/WarrantService/submit") #SOAP Action for a Protection Order #conn.putheader("SOAPAction", "http://wijis.wisconsin.gov/services/ProtectionOrderService/") conn.endheaders() conn.send(SoapMessage) response = conn.getresponse() print response.read()