I am trying to consume the FastraxNetwork webservice using SOAP and XML. The example they provided was a .Net example in C#. So I needed to come up with my own solution to consume their webservice. Using the documentation that is provided here
https://ws.fastraxonline.com/Fastrax...axNetwork.asmx
Using this I am able to login to the system, which is the first requirement they have, and retrieve my login credentials. However, when I try to request a SSN trace as well as a criminal background check I am not able to complete my request.
here is an example of my code
Code:
<%
sXML = "<?xml version = ""1.0"" encoding=""utf-8""?>"
sXML = sXML & "<FastraxRequests>" & "<request>"
sXML = sXML & "<subject-info>"
sXML = sXML & "<first-name>" & FirstName & "</first-name>"
sXML = sXML & "<last-name>" & LastName & "</last-name>"
sXML = sXML & "<dob>" & DatePart("yyyy",DOB) & "-" & DatePart("m",DOB) & "-" & DatePart("d",DOB) & "</dob>"
sXML = sXML & "<ssn>" & Left(SSN,3) & "-" & Mid(SSN,4,2) & "-" & Right(SSN,4) & "</ssn>"
sXML = sXML & "<****>" & Gender & "</****>"
sXML = sXML & "<address-info>"
sXML = sXML & "<address>"
sXML = sXML & "<street-name>" & Address & "</street-name>"
sXML = sXML & "<city>" & City & "</city>"
sXML = sXML & "<state>" & StateCode & "</state>"
sXML = sXML & "<zip>" & ZipCode & "</zip>"
sXML = sXML & "</address>"
sXML = sXML & "</address-info>"
sXML = sXML & "<maiden-name>" & MaidenName & "</maiden-name>"
sXML = sXML & "<felony-misd>" & boolConvicted & "</felony-misd>"
sXML = sXML & "<served-time>" & boolServedTime & "</served-time>"
sXML = sXML & "<criminal-explan>" & ConvictedExplain & "</criminal-explan>"
sXML = sXML & "</subject-info>"
sXML = sXML & "<report-info>"
sXML = sXML & "<combined-report combined-report-id=""798"">"
sXML = sXML & "<report-data>"
Rem COUNTY COURTS LIST THE STATES AND COUNTIES THAT THE APPLICANT HAS LISTED
sXML = sXML & "<criminalcounty>"
sXML = sXML & "<location-info>"
sXML = sXML & "<state>" & StateCode & "</state>"
sXML = sXML & "<county>" & County & "</county>"
sXML = sXML & "</location-info>"
sXML = sXML & "</criminalcounty>"
sSQL = "usp_ViewPreviousAddress '" & UserID & "'"
oRs.Open sSQL, myDSN
Do Until oRs.EOF
If StateCode <> oRs("PreviousState") OR County <> oRs("PreviousCounty") Then
sXML = sXML & "<criminalcounty>"
sXML = sXML & "<location-info>"
sXML = sXML & "<state>" & StateCode & "</state>"
sXML = sXML & "<county>" & County & "</county>"
sXML = sXML & "</location-info>"
sXML = sXML & "</criminalcounty>"
End If
oRs.MoveNext
Loop
oRs.Close
Set oRs = Nothing
sXML = sXML & "<ssntracereport />"
sXML = sXML & "</report-data>"
sXML = sXML & "</combined-report>"
sXML = sXML & "</report-info>"
sXML = sXML & "<notifications>"
sXML = sXML & "<email-addr>" & EmailAddress & "</email-addr>"
sXML = sXML & "</notifications>"
sXML = sXML & "</request>"
sXML = sXML & "</FastraxRequests>"
sUrl = "https://ws.fastraxonline.com/FastraxRequest/FastraxNetwork.asmx" 'location of webservice
sClientID = "TheClientID#123456" 'login userid and location
sPassword = "ThePassword" 'Siemens password
REM Login to Fastrax network
Set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oXMLHTTP.Open "POST", sUrl, false
oXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXMLHTTP.setRequestHeader "SOAPAction", "http://www.fastraxonline.com/webservices/request/Login"
SOAPRequest = "<?xml version=""1.0"" encoding=""utf-8""?>"
SOAPRequest = SOAPRequest & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
SOAPRequest = SOAPRequest & "<soap:Body>"
SOAPRequest = SOAPRequest & "<Login xmlns=""http://www.fastraxonline.com/webservices/request/"">"
SOAPRequest = SOAPRequest & "<custLocation>" & sClientID & "</custLocation>"
SOAPRequest = SOAPRequest & "<password>" & sPassword & "</password>"
SOAPRequest = SOAPRequest & "</Login>"
SOAPRequest = SOAPRequest & " </soap:Body>"
SOAPRequest = SOAPRequest & " </soap:Envelope>"
oXMLHTTP.Send(SOAPRequest)
respon****ML = oXMLHTTP.Respon****ML.XML
Set oXML = Server.CreateObject("Msxml2.DomDocument")
oXML.async = False
oXML.loadXML(respon****ML)
Rem assign values returned to variables to use in the background request
****pires = oXML.documentElement.selectSingleNode("soap:Body/LoginResponse/LoginResult/EXPIRE").text
sToken = oXML.documentElement.selectSingleNode("soap:Body/LoginResponse/LoginResult/loginToken").text
sIPAddr = oXML.documentElement.selectSingleNode("soap:Body/LoginResponse/LoginResult/ipAddr").text
sPubKey = oXML.documentElement.selectSingleNode("soap:Body/LoginResponse/LoginResult/pubKey").text
sSessionStart = oXML.documentElement.selectSingleNode("soap:Body/LoginResponse/LoginResult/sessionStart").text
Set oXML = Nothing
Set oXMLHTTP = Nothing
respon****ML = ""
Rem send the background request encapsulated in the soap envelope
Set oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oXMLHTTP.Open "POST", sUrl, false
'oXMLHTTP.setRequestHeader "Host", "ws.fastraxonline.com"
oXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oXMLHTTP.setRequestHeader "SOAPAction", "http://www.fastraxonline.com/webservices/request/InsertRequests"
SOAPRequest = "<?xml version=""1.0"" encoding=""utf-8""?>" & vbCrLf
SOAPRequest = SOAPRequest & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & vbCrLf
SOAPRequest = SOAPRequest & "<soap:Header>" & vbCrLf
SOAPRequest = SOAPRequest & "<FastraxLogin xmlns=""http://www.fastraxonline.com/webservices/request/"">" & vbCrLf
SOAPRequest = SOAPRequest & "<EXPIRE>" & ****pires & "</EXPIRE>" & vbCrLf
SOAPRequest = SOAPRequest & "<loginToken>" & sToken & "</loginToken>" & vbCrLf
SOAPRequest = SOAPRequest & "<customerID>TheClientID</customerID>" & vbCrLf
SOAPRequest = SOAPRequest & "<custLocation>" & sClientID & "</custLocation>" & vbCrLf
SOAPRequest = SOAPRequest & "<clientType>BRANCH</clientType>" & vbCrLf
SOAPRequest = SOAPRequest & "<ipAddr>" & sIPAddr & "</ipAddr>" & vbCrLf
SOAPRequest = SOAPRequest & "<pubKey>" & sPubKey & "</pubKey>" & vbCrLf
SOAPRequest = SOAPRequest & "<sessionStart>" & sSessionStart & "</sessionStart>" & vbCrLf
SOAPRequest = SOAPRequest & "</FastraxLogin>" & vbCrLf
SOAPRequest = SOAPRequest & "</soap:Header>" & vbCrLf
SOAPRequest = SOAPRequest & "<soap:Body>" & vbCrLf
SOAPRequest = SOAPRequest & "<InsertRequests xmlns=""http://www.fastraxonline.com/webservices/request/"">" & vbCrLf
SOAPRequest = SOAPRequest & "<xmlString>" & sXML & "</xmlString>" & vbCrLf
SOAPRequest = SOAPRequest & "</InsertRequests>" & vbCrLf
SOAPRequest = SOAPRequest & " </soap:Body>" & vbCrLf
SOAPRequest = SOAPRequest & " </soap:Envelope>" & vbCrLf
oXMLHTTP.Send(SOAPRequest)
respon****ML = oXMLHTTP.ResponseText
Set oXML = Server.CreateObject("Msxml2.DomDocument")
oXML.async = False
oXML.loadXML(respon****ML)
' RequestID = oXML.documentElement.selectSingleNode("FastraxNetwork/request/request-id").text
Set oXML = Nothing
Set oXMLHTTP = Nothing
%>
Can anyone see what I might be doing wrong?