Scheduling a WebService

How to schedule a webservice method call (using MS Task Scheduler)? The only way I could find was to create a VBS file that calls the WS, and schedule that:

Set oServerXML = CreateObject("Msxml2.ServerXMLHTTP") 

oServerXML.Open "GET","http://localhost/wsPDF/Pdf.asmx/CreateFromQueue?", False
oServerXML.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
oServerXML.send
Set oServerXML = nothing

3 Comments

  • What about a Windows Service w/ a timer using HttpWebRequest/Response classes?



    Although, I believe your solution requires less code. Just a thought.



    2¢

    Christopher

  • Yep - we talked about that solution, too. We decided to go with this in the interests of maintainability. Also, there's just something that bugs me about installing windows services just to schedule things when there's already a Task Scheduler. If we ended up scheduling more than a few of these, though, it would be worth setting up a service that could call different webservices.



    It's funny that there's no .NET canned solution to this when .NET is "a platform for building and consuming web services". Cold Fusion has a scheduler that does this exact thing - it works great, in my (extremely) limited experience.

  • Of course you could just write a simple .NET console app..very simple...

Comments have been disabled for this content.