Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript Call webmethod assist

Status
Not open for further replies.

ghloid

IS-IT--Management
Mar 11, 2002
85
0
0
US
I'm pretty new with the webservices/web reference idea, so I'm probably going to explain some of this wrong. Nevertheless...here goes:
I would like to create a simple VBScript which will run as a scheduled task on a computer. When the script sees that there is no E drive present, it should send me an email using an ASMX web service. I beleive SOAP would be the method by which I would "invoke" the web service. Of course that's where I'm pretty much lost (did quite a bit of Googling too). I believe I need to use the SOAPclient here (seems reasonable), but using the mssoapinit method of the soapclient requires a WSDL file. Don't know what that is, but my file is a straight ASMX file.

When the webservice is created, I should be able to call a web method from the service which will create the email message and pass it along (all via the web service). This does work fine in several VB.Net applications when calling the web service, but of course I was hoping for a simpler VBSCript idea here. Here's some basic code I have so far:

Code:
' Drive specifications
Dim Drv, DrvType, DrvName, DrvReady, FSO, oSoap, MyMessage
' First creat an FSO objectSet 
FSO = CreateObject("Scripting.FileSystemObject")
DrvName = "E"
Drv = FSO.GetDrive(DrvName)
If Drv.IsReady Then 
	DrvReady = "Ready" 
Else 
	DrvReady = "Not Ready"
End If

If DrvReady = "Not Ready" Then
	'create a soap client here and pass the web services url
	Set oSoap = CreateObject("MSSOAP.soapclient")
' use mssoapinit to connect to web service?
	oSoap.mssoapinit("[URL unfurl="true"]http://sapableiis.supreme.pacourts.us:8080/EELS_WS/EELS_WS/message.asmx")[/URL]
       ' Use the web method here
        oSoap.createmessage(variable, variable,MessageText)
	
End If

Hoping this would be somewhat easy, but not so far.

Any help is greatly appreciated.

Thanks!
 
Looks like I may not need the assist with this one after all. I've decided to revamp my code and design the project in Visual Studio. It is easier to get to a web reference using that. Still like to know if there's a way to add the web reference via VBScript. I'm positive there is. It's beyond me right now though.

Respond if anyone has time and I can still look at it (would be helpful for future projects).

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top