S
Sparticus
Hello,
First off I'll say I'm very new to web services.
I have a classic asp page that wants to connect to a web service and
get information. I have it working that it connects and can get
data.... but now we have added a username/password to the web
service... how do I modify my code to pass in a username and password
so that it works like it did before?
Thanks in advance!!
Here is the code I used to connect :
<% Response.Write(consumeWebService())
Function consumeWebService()
Dim webServiceUrl, httpReq, node, myXmlDoc
webServiceUrl = "http://MyWebService/LegalSurveySearch.asmx?
op=StateNames"
Set httpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
httpReq.Open "GET", webServiceUrl, False
httpReq.Send
Set myXmlDoc =Server.CreateObject("MSXML.DOMDocument")
myXmlDoc.load(httpReq.responseBody)
httpReq = Nothing
node = myXmlDoc.documentElement.selectSingleNode("//StateNames")
If Not node Is Nothing Then
consumeWebService = "<b>That zipcode is within this city:</
b><font color = blue>" & node.text & "</font>"
Exit Function
Else
consumeWebService = "<b>There is no location associated with
that zipcode.</b>"
Exit Function
End If
End Function
%>
First off I'll say I'm very new to web services.
I have a classic asp page that wants to connect to a web service and
get information. I have it working that it connects and can get
data.... but now we have added a username/password to the web
service... how do I modify my code to pass in a username and password
so that it works like it did before?
Thanks in advance!!
Here is the code I used to connect :
<% Response.Write(consumeWebService())
Function consumeWebService()
Dim webServiceUrl, httpReq, node, myXmlDoc
webServiceUrl = "http://MyWebService/LegalSurveySearch.asmx?
op=StateNames"
Set httpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
httpReq.Open "GET", webServiceUrl, False
httpReq.Send
Set myXmlDoc =Server.CreateObject("MSXML.DOMDocument")
myXmlDoc.load(httpReq.responseBody)
httpReq = Nothing
node = myXmlDoc.documentElement.selectSingleNode("//StateNames")
If Not node Is Nothing Then
consumeWebService = "<b>That zipcode is within this city:</
b><font color = blue>" & node.text & "</font>"
Exit Function
Else
consumeWebService = "<b>There is no location associated with
that zipcode.</b>"
Exit Function
End If
End Function
%>