locked
Calling Web Service Method From Batch File RRS feed

  • Question

  • User364803292 posted

    Hello all

    I need to call a .net web service (wsSchedules.asmx) method called UpdateFields with no parameters from a batch file which will be executed according to a task schedule created in plesk.

    Can anyone post an expample of how can I achive that?

    Is it possible to test the batch file locally?

    Thank you

    Thursday, February 20, 2014 8:04 AM

Answers

  • User-417640953 posted

    Hi Taonias,

    Thank you post the issue to asp.net forum.

    In my mind, I think we may not invoke a web service method directly from a batch file(.bat).

    What we should do is that create a basic c# or VB application to invoke the web service and then use a batch file to invoke the created application.

    There is a demo for calling a Web Service from a Command-Line with the VBScript.

    Save the following as MSFT.vbs:
    
    set SOAPClient = createobject("MSSOAP.SOAPClient")
    SOAPClient.mssoapinit "http://www.webservicex.net/stockquote.asmx?WSDL"
    WScript.Echo "MSFT = " & SOAPClient.GetQuote("MSFT")
    
    
    Then from a command prompt, run:  C:\>MSFT.vbs
    

    For more information, you can refer to below blog.

    http://blogs.msdn.com/b/bgroth/archive/2004/10/21/246155.aspx

    Hope this helps, thanks.

    Best Regards!

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 21, 2014 2:14 AM