One way to connect to the Wijis Gateway is through using the programming language python. This guide will step you through how to invoke Wijis pointer services using simple python scripts. To succesfully use these scripts, you will need to have a signed certificate and a private key file. Click here more information on certificates
X.509 is a well-established standard for Public Key Infrastructure. WIJIS uses public key certificates that conform to the X.509 specification.
The certificate is a small file that is placed on the machine that is communicating with a server. Traffic will not be accepted by that server without the additional signature-like artifacts, generated based on the file's content, that are added to each and every message. This provides additional account security and (perhaps more importantly) prevents IP spoofing of traffic from an established session.
Wijis staff will provide all submitters with sample request files to invoke Wijis Services. Please contact Wijis for these sample files. They are invocation examples similiar to what is on wijiscommons.org.
The python scripts provided will use these sample request files to invoke the pointer services.
#!/usr/bin/env python import httplib import sys SM_TEMPLATE = open(sys.argv, 'r') SoapMessage = SM_TEMPLATE.read() CERTFILE = "myCertificate.cer" KEYFILE = "myPrivateKey.key" #print KEYFILE #print CERTFILE HOSTNAME = "wijisgwtest.wisconsin.gov:17444" conn = httplib.HTTPSConnection( HOSTNAME, key_file = KEYFILE, cert_file = CERTFILE ) print SoapMessage #construct and send the header conn.putrequest('POST', '/xfire/PointerCount') conn.putheader("Host", "wijisgwtest.wisconsin.gov") conn.putheader("User-Agent", "Python post") conn.putheader("Content-type", "text/xml; charset=\"UTF-8\"") conn.putheader("Content-length", "%d" % len(SoapMessage)) conn.putheader("SOAPAction", "\"\"") conn.endheaders() conn.send(SoapMessage) response = conn.getresponse() print response.read()
For your convenience, a sample invocation XML file for Kenosha is included below:
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <messageTrackingInfo xmlns="http://wijis.wisconsin.gov/specs/schemas/message/v1.1/2007-01-12/" xmlns:svc="http://wijis.wisconsin.gov/specs/schemas/service/v1.1/2007-01-12/" xmlns:uri="http://wijis.wisconsin.gov/specs/schemas/uri/v1.1/2007-01-12/" svc:currentSendingOperatorURI="http://wijis.wisconsin.gov/names/operators/KenoshaJointServices/" branchStack="0" svc:currentServiceDefURI="http://wijis.wisconsin.gov/gateway/services/Pointer/request/countMyPointers/" svc:serviceLabel="dont know" svc:currentServiceLabel="dont know" svc:serviceInvocationNum="0" uri:serviceDefURI="http://wijis.wisconsin.gov/gateway/services/Pointer/request/countMyPointers/" svc:serviceRequesterURI="http://wijis.wisconsin.gov/names/operators/KenoshaJointServices/" svc:initialUserURI="http://TO_BE_DETERMINED@wijis.wisconsin.gov/names/directories/justiceDirectory/" svc:requesterInvocationNum="0" svc:serviceProviderURI="http://wijis.wisconsin.gov/names/operators/jil/" svc:currentServiceProviderURI="http://wijis.wisconsin.gov/names/operators/jil/" convSeq="0" /> </messageTrackingInfo> </soap:Header> <soap:Body> <pointerCount xmlns="http://wijis.wisconsin.gov/specs/schemas/gateway/service/pointerCount/v1.1/" xmlns:uri="http://wijis.wisconsin.gov/specs/schemas/uri/v1.1/2007-01-12/" uri:submitterURI="http://wijis.wisconsin.gov/names/operators/KenoshaJointServices/CityOfKenoshaPD/" /> </pointerCount> </soap:Body> </soap:Envelope>
The way to run this script is as follows: python thisScript.py invocation_file.xml
You would save the code above to a file called 'thisScript.py' and the xml above to a file name invocation_file.xml. The invocation file is the actual soap message that you are going to send.Configure the Code for other Pointer Services
The following parameters can be changed to customize the script:
CERTFILE: This is your certificate file.
KEYFILE: This is your private key.
HOSTNAME: This is the server/port you are trying to hit (use wijis.wisconsin.gov:17444 to hit production, the script currently hits staging).
The script currently invokes 'pointerCount'.
To invoke pointerUpload or pointerDownload, change this line:
For pointerUpload use:
For pointerDownload use:
For a more sophisticated client, you can consider using .NET or Java.