Licence Check API
WSDL base URL -> https://www.deltager.no/webservice/LicenseCheck.asmx
Raw SOAP request/response example here
pysimplesoap module implements Soap1.2
>>> from pysimplesoap.client import SoapClient
>>> _client = SoapClient('https://www.deltager.no/webservice/LicenseCheck.asmx',
namespace="http://participant.co.uk/webservice", trace=False)
>>> _client.FindLicense(request=dict(AuthUserName='opentrack', AuthPassword='#3I%l4Psnc0w',
EventDate='2020-02-02', FirstName='Maria', LastName='Aaberg',
DOB='2001-10-05'))
INFO:pysimplesoap.client:POST https://www.deltager.no/webservice/LicenseCheck.asmx
DEBUG:pysimplesoap.client:Content-length: 552
Content-type: text/xml; charset="UTF-8"
DEBUG:pysimplesoap.client:<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header/>
<soap:Body>
<FindLicense xmlns="http://participant.co.uk/webservice">
<request><AuthUserName>opentrack</AuthUserName><FirstName>Maria</FirstName><DOB>2001-10-05</DOB><LastName>Aaberg</LastName><AuthPassword>#3I%l4Psnc0w</AuthPassword><EventDate>2020-02-02</EventDate></request></FindLicense>
</soap:Body>
</soap:Envelope>
DEBUG:pysimplesoap.client:status: 200
content-length: 507
x-aspnet-version: 4.0.30319
set-cookie: SID1=6372014375425646860352182006; expires=Wed, 18-Mar-2020 15:10:54 GMT; path=/, participantId=0; expires=Wed, 18-Mar-2020 15:55:54 GMT; path=/, userAccountId=0; expires=Wed, 18-Mar-2020 15:55:54 GMT; path=/, affId=1; expires=Thu, 19-Mar-2020 07:35:54 GMT; path=/, refresh_1=0; expires=Wed, 18-Mar-2020 15:05:54 GMT; path=/
expires: Wed, 18 Mar 2020 14:54:54 GMT
server: Microsoft-IIS/8.5
cache-control: private, max-age=0
date: Wed, 18 Mar 2020 14:55:53 GMT
x-powered-by: ASP.NET
content-type: text/xml; charset=utf-8
DEBUG:pysimplesoap.client:<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><FindLicenseResponse xmlns="http://participant.co.uk/webservice"><FindLicenseResult><FirstName>Maria</FirstName><LastName>Aaberg</LastName><Sucess>true</Sucess><LicenseID>131012</LicenseID><DOB>2001-10-05T00:00:00</DOB></FindLicenseResult></FindLicenseResponse></soap:Body></soap:Envelope>
Request with missing params (without DOB):
>>> _client.FindLicense(request=dict(AuthUserName='opentrack', AuthPassword='#3I%l4Psnc0w',
EventDate='2020-02-02', FirstName='Maria', LastName='Aaberg'))
>>> print(_client.xml_request)
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header/>
<soap:Body>
<FindLicense xmlns="http://participant.co.uk/webservice">
<request><LastName>Aaberg</LastName><AuthUserName>opentrack</AuthUserName><EventDate>2020-02-02</EventDate><FirstName>Maria</FirstName><AuthPassword>#3I%l4Psnc0w</AuthPassword></request></FindLicense>
</soap:Body>
</soap:Envelope>
>>> print(_client.xml_response)
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><FindLicenseResponse xmlns="http://participant.co.uk/webservice"><FindLicenseResult><Sucess>false</Sucess><LicenseID>0</LicenseID><DOB>0001-01-01T00:00:00</DOB><ErrorMessage>Missing arguments. Either provide 1) LicenseID or 2) FirstName, LastName and DOB</ErrorMessage></FindLicenseResult></FindLicenseResponse></soap:Body></soap:Envelope>
API so far:
>>> from project.comp.custom import country_nor
# get licence id
>>> country_nor.get_licence('Maria', 'Aaberg', '2001-10-04')
{u'DOB': u'0001-01-01T00:00:00', u'LicenseID': u'0', u'Sucess': u'false', u'ErrorMessage': u'No record found'}
>>> country_nor.get_licence('Maria', 'Aaberg', '2001-10-05')
{u'DOB': u'2001-10-05T00:00:00', u'LastName': u'Aaberg', u'LicenseID': u'131012', u'Sucess': u'true', u'FirstName': u'Maria'}
>>> country_nor.get_licence('Maria', 'Aaberg', '2001-10-35')
{'ErrorMessage': "soap:Client: Server was unable to read request. ---> There is an error in XML document (5, 102). ---> The string '2001-10-35' is not a valid AllXsd value.", 'LicenseID': '0', 'Sucess': 'false'}
>>> country_nor.get_licence('Maria', '', '2001-10-05')
{u'DOB': u'0001-01-01T00:00:00', u'LicenseID': u'0', u'Sucess': u'false', u'ErrorMessage': u'Missing arguments. Either provide 1) LicenseID or 2) FirstName, LastName and DOB'}
# get_details
>>> country_nor.get_details(licence_id='131012')
{u'DOB': u'2001-10-05T00:00:00', u'LastName': u'Aaberg', u'LicenseID': u'131012', u'Sucess': u'true', u'FirstName': u'Maria'}
>>> country_nor.get_details(licence_id=131012)
{u'DOB': u'2001-10-05T00:00:00', u'LastName': u'Aaberg', u'LicenseID': u'131012', u'Sucess': u'true', u'FirstName': u'Maria'}
>>> country_nor.get_details()
{u'LicenseID': u'0', u'Sucess': u'false', u'ErrorMessage': u'soap:Client: Server was unable to read request. ---> There is an error in XML document (5, 76). ---> Input string was not in a correct format.'}
>>> country_nor.get_details(licence_id='asd')
{u'LicenseID': u'0', u'Sucess': u'false', u'ErrorMessage': u'soap:Client: Server was unable to read request. ---> There is an error in XML document (5, 79). ---> Input string was not in a correct format.'}
>>> country_nor.get_details(licence_id=123)
{u'DOB': u'0001-01-01T00:00:00', u'LicenseID': u'0', u'Sucess': u'false', u'ErrorMessage': u'No record found'}