Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2008, 10:10 AM
Registered User
 
Join Date: Jul 2008
Location: Dallas, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default consume a webservice

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?


Reply With Quote
  #2 (permalink)  
Old July 9th, 2008, 01:45 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Oh, how funny! In that code all occurrences of the three letter sequence
[s][e][x] are replaced by ****
so Respon[s][e][X]ML becomes Respon****ML

I don't know that answer to your question; just thought I'd help make it readable for others if they didn't happend to see the silly forum substitution.
Reply With Quote
  #3 (permalink)  
Old July 9th, 2008, 04:21 PM
Registered User
 
Join Date: Jul 2008
Location: Dallas, TX, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just noticed that myself. Thats too funny. :D
Thanks anyway Bill



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Consume VB6.0 WebService in ASP.NET using VB.NET pinkarc .NET Web Services 1 March 5th, 2007 08:19 AM
How to consume a web service jlwilliamson .NET Web Services 7 November 14th, 2006 11:08 AM
Listing 11-7 Consume an RSS feed. Asp.Net BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 November 9th, 2006 05:26 AM
webservice hanuyedluri .NET Web Services 1 March 21st, 2004 05:16 PM
Consume a Web Service from Classic ASP pranoliver Classic ASP Professional 1 February 25th, 2004 10:56 AM



All times are GMT -4. The time now is 03:40 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.