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:
Option Explicit ' Variables to hold information about a user and their machine Dim sUser Dim sComputer Dim wn Dim xmlDOC Dim bOK Dim HTTP Set wn = CreateObject("WScript.Network") sUser = wn.UserName sComputer = wn.ComputerName Set HTTP = CreateObject("MSXML2.XMLHTTP") Set xmlDOC =CreateObject("MSXML.DOMDocument") xmlDOC.Async=False HTTP.Open "GET","http://mydomain/mywebservice.asmx/LogUser?sUser=" & sUser, False HTTP.Send() bOK = xmlDOC.load(HTTP.responseXML) if Not bOK then msgbox("Error") else msgBox("Update successfull") end if




Reply With Quote