Link to home
Start Free TrialLog in
Avatar of pankajgharge
pankajghargeFlag for India

asked on

Consuming web service in classic ASP

Hello,
I am new to classic ASP. What is wrong in bellow code.
The code prints "Document not Loaded"
<html>
<head>
<title></title>
</head>
<body>
 
<%  
 
    Dim webServiceUrl, httpReq, node, myXmlDoc
    webServiceUrl = "http://cpp.cisco.com/cpp/CPPLDAP/CPPLDAP.asmx/AuthenticateCiscoUser?db=1&_username=myUserName&_password=myPassword!"
    'webServiceUrl = "http://teachatechie.com/GJTTWebServices/ZipCode.asmx/GetLocation?ZipCode=32218"
    
    Set httpReq = Server.CreateObject("MSXML2.ServerXMLHTTP") 
    
    httpReq.Open "GET", webServiceUrl, False 
    httpReq.Send 
    
    Set myXmlDoc =Server.CreateObject("MSXML.DOMDocument")	
 
    if myXmlDoc.load(httpReq.responseBody) Then
       Response.write("document loaded")
 
    else
       Response.write("document not loaded")
    end If
    
    Set httpReq = Nothing 
    'title = myXmlDoc.documentElement.ChildNodes(1).text
    'Response.write(title)
    
    'Set node = myXmlDoc.documentElement.selectSingleNode("//CITYSTNAME") 
    
    'If Not node Is Nothing Then 
        'consumeWebService = "<b>That zipcode is within this city:</b><font color = blue>" & node.text & "</font>" 
 
    'Else 
        'consumeWebService = "<b>There is no location associated with that zipcode.</b>" 
 
    'End If    
'Response.Write(consumeWebService)
         
%>
 
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of JoachimMartinsen
JoachimMartinsen
Flag of Norway 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
Avatar of pankajgharge

ASKER

Thanks, JoachimMartinsen
The document is loaded no issues.
But how can I catch a response of webservice. Its a authentication webservice and I need true or false in response.
I am very very new to asp page.