Results 1 to 1 of 1

Thread: Webservice problem *** Resolved ***

  1. #1

    Thread Starter
    Hyperactive Member MarkusJ_NZ's Avatar
    Join Date
    Jun 2001
    Posts
    375

    Webservice problem *** Resolved ***

    Hi all, I have created a webservice that I use to log a persons details into SQL an MSQL 2000 database.

    The service works fine when I call it from an application/ over the Internet from a browser.

    What I want to do is execute the webservice from a login script ..

    Does anyone have any code about how to call a webservice from a batch file or a VBScript file??

    Specs Windows 2000

    Cheers
    MarkusJ

    ===========

    I wrote the following code in VBSCript and it seems to work

    VB Code:
    1. Option Explicit
    2.  
    3. ' Variables to hold information about a user and their machine
    4. Dim sUser
    5. Dim sComputer
    6. Dim wn
    7. Dim xmlDOC
    8. Dim bOK
    9. Dim HTTP
    10.  
    11. Set wn = CreateObject("WScript.Network")
    12.  
    13. sUser = wn.UserName
    14. sComputer = wn.ComputerName
    15.  
    16. Set HTTP = CreateObject("MSXML2.XMLHTTP")
    17. Set xmlDOC =CreateObject("MSXML.DOMDocument")
    18. xmlDOC.Async=False
    19. HTTP.Open "GET","http://mydomain/mywebservice.asmx/LogUser?sUser=" & sUser, False
    20. HTTP.Send()
    21. bOK = xmlDOC.load(HTTP.responseXML)
    22. if Not bOK then
    23. msgbox("Error")
    24. else
    25. msgBox("Update successfull")
    26. end if
    Last edited by MarkusJ_NZ; Apr 28th, 2003 at 09:11 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width