Link to home
Start Free TrialLog in
Avatar of chameleon84
chameleon84

asked on

SOAP call via classic ASP

I am attempting to utilize SOAP data provided by a rail tracking company via an ASP application that we have developed.  I have read through and attempted to use the post found here, https://www.experts-exchange.com/questions/23099358/How-do-I-grab-data-from-an-external-server-using-SOAP-and-classic-ASP.html but I'm not having any luck.

The company provided the WSDL document to me for reference, https://www.steelroads.com/wsdl/com/steelroads/ws/model/TatService.wsdl as well as this url for submission of the requests, https://www.steelroads.com/services/TatService.

I am attempting to use the following code to access this information,


I'll be honest that I have no idea how to call this type of info but I am REALLY stuck now.  Any help that anyone could provide would be greatly appreciated.  thanks

<%
Dim objXMLHTTP : SET  objXMLHTTP = Server.CreateObject("Msxml2.XMLHTTP.3.0")
Dim objOutputXMLDoc : Set objOutputXMLDoc = Server.CreateObject("MSXML.DOMDocument")
 
Dim strMethodPkg
Dim strMethodResultXML
 
strMethodPkg ="<?xml version=""1.0"" encoding=""utf-8""?>"
strMethodPkg = strMethodPkg &"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:mod=""http://model.ws.steelroads.com"">"
strMethodPkg = strMethodPkg & "<soapenv:Header/>"
strMethodPkg = strMethodPkg & "<soapenv:Body>"
strMethodPkg = strMethodPkg & "<mod:runDynamicTrace>"
strMethodPkg = strMethodPkg & "<mod:userId>username</mod:userId>"
strMethodPkg = strMethodPkg & "<mod:password>password</mod:password>"
strMethodPkg = strMethodPkg & "<mod:params>"
strMethodPkg = strMethodPkg & "<mod:equipmentList>CAXU959708-2</mod:equipmentList>"
strMethodPkg = strMethodPkg & "<mod:equipStatus>Loads+Only</mod:equipStatus>"
strMethodPkg = strMethodPkg & "<mod:outputType>Display+In+Browser</mod:outputType>"
strMethodPkg = strMethodPkg & "<mod:responseOption>New+Events</mod:responseOption>"
strMethodPkg = strMethodPkg & "<mod:showEvents>Intransit+Arrival</mod:showEvents>"
strMethodPkg = strMethodPkg & "<mod:sortOrder>001030</mod:sortOrder>"
strMethodPkg = strMethodPkg & "<mod:traceFormat>E</mod:traceFormat>"
strMethodPkg = strMethodPkg & "</mod:params>"
strMethodPkg = strMethodPkg & "</mod:runDynamicTrace>"
strMethodPkg = strMethodPkg & "</soapenv:Body>"
strMethodPkg = strMethodPkg & "</soapenv:Envelope>"
 
'Response.write strMethodPkg
 
objXMLHTTP.open "post", "https://www.steelroads.com/services/TatService", False
 
objXMLHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
objXMLHTTP.setRequestHeader "Content-Length", Len(strMethodPkg)
 
 
objXMLHTTP.setRequestHeader "SOAPAction", "https://www.steelroads.com/services/TatService"
 
Call objXMLHTTP.send(strMethodPkg)
 
strMethodResultXML = objXMLHTTP.responsetext
 
Response.Write strMethodResultXML%>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of _Stilgar_
_Stilgar_
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial