my code for calling webservice in asp is not working

Joined
May 22, 2008
Messages
1
Reaction score
0
Object required: 'myXmlDoc.documentElement'

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENER0ATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>



<form name="form1" method="get">
<p>empdata&nbsp;&nbsp;&nbsp; <input type="text" name="empno" size="20">&nbsp;
FirstName <input type="text" name="FristName" size="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" value="Submit" name="B1"></p>
<p>&nbsp;</p>
</form>

<%
if request.form("B1")="Submit" then

Response.Write empdata("12345")

Function pandata(empno)
Dim webServiceUrl, httpReq, node, myXmlDoc


webServiceUrl = "http://localhost/webservices/MyWebService.asmx/empdata?empno='12345'"

Set httpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")

httpReq.Open "GET", webServiceUrl, False
httpReq.Send

Set myXmlDoc = Server.CreateObject("MSXML.DOMDocument")



myXmlDoc.load(httpReq.responseBody)

Set httpReq = Nothing

Set node = myXmlDoc.documentElement.selectSingleNode("//empdata1")


If Not node Is Nothing Then
empdata = node.text

Exit Function
Else
empdata = "<b>There is no data associated with this empno.</b>"
Exit Function
End If
End Function
--------------------------------------------------------------
thanks in advance



End Function
End If
%>
</body>
</html>
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top