'**************************************************************
'MAKE THE CALL TO GET THE CREDIT SCORE
'Try
' create an HttpWebRequest object to communicate with Experian
objRequest = CType(WebRequest.Create(EcalsURL), HttpWebRequest)
objRequest.Method = "POST"
objRequest.ContentLength = post_string.Length
objRequest.ContentType = "application/x-www-form-urlencoded"
objRequest.Headers("Authorization") = "BASIC " & authorization_string
' post data is sent as a stream
myWriter = Nothing
myWriter = New StreamWriter(objRequest.GetRequestStream())
myWriter.Write(post_string)
myWriter.Close()
' returned values are returned as a stream, then read into a string
objResponse = CType(objRequest.GetResponse(), HttpWebResponse)
If objResponse.StatusCode = 200 Then
responseStream = New StreamReader(objResponse.GetResponseStream())
post_response = responseStream.ReadToEnd()
responseStream.Close()
objXML = New XmlDocument()
objXML.LoadXml(post_response)
Dim objStreamWriter As StreamWriter
objStreamWriter = File.AppendText(Server.MapPath("Output.txt"))
objStreamWriter.WriteLine(post_response)
objStreamWriter.Close()
myNode = objXML.SelectSingleNode("//CompletionCode")
If Not myNode Is Nothing Then
...
|