my code for calling webservice in asp is not working

Discussion in '.NET' started by sphere, May 22, 2008.

  1. sphere

    sphere

    Joined:
    May 22, 2008
    Messages:
    1
    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: May 28, 2008
    sphere, May 22, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. batista
    Replies:
    1
    Views:
    899
    Laurent Bugnion
    Jan 26, 2006
  2. batista
    Replies:
    0
    Views:
    554
    batista
    Jan 26, 2006
  3. Peter Nordström

    Webservice calling a webservice.....Error

    Peter Nordström, Oct 21, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    154
    Peter Nordström
    Oct 21, 2003
  4. bgauvey@gmail.com

    Calling a webservice from a webservice

    bgauvey@gmail.com, Apr 19, 2005, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    145
  5. batista
    Replies:
    0
    Views:
    247
    batista
    Jan 26, 2006
Loading...

Share This Page