locked
How to automate the webservice or WCF RRS feed

  • Question

  • User-594116948 posted

    Hi pals,

              I have added webservice  via web reference  option in .Net 2.0.Actuall its a data pulling logic[like fetching data via dataset and inserting in to our DB) from the upstreams application.Now my queries how can u automate my asp.net application that should run every day once at a time.Please help.

    Thursday, March 14, 2013 2:44 AM

Answers

  • User220959680 posted

    1. Console application, which acts as service Client 

    //Create an instance of WCFService proxy (service contract)
    <WCFServiceContract> client = new <WCFServiceContract>();
    client.Open();
    client.<Method that perform the operation>
    Client.Close();



    2. Windows scheduler (Programs >Task scheduler)  runs above Console app at specified intervals (Day with Time etc).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 15, 2013 7:28 AM
  • User2120624532 posted

    Log on as administrator.
    Open Task Scheduler by either typing "task" into the Start Menu search bar, or by opening All Programs - Accessories - System Tools.


    Select 'Create Basic Task' from the right hand pane and the 'Create Basic Task Wizard will open.

    Type a 'Name' and 'Description'  for your new task and click Next

    Select when you would like the event/task to run and click next. I am selecting daily.

    Select exact time when you want to run the application and click next.

    Select action and click next. I am selecting here Start a program.

    Click ‘Browse’ and select the exe file form the  folder and click next.
    Click Finish.

    For shortage of time I am providing here basic steps.
    To see step by step please visit: http://cybarlab.blogspot.com/2013/03/run-c-sharp-console-application-using.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2013 7:53 AM

All replies

  • User-972560101 posted

    Try to host it in web server (IIS) and also write the condition for executing one time a day

    Webservice and WCF have the features to running automatically.

    Friday, March 15, 2013 1:17 AM
  • User-594116948 posted

    I had hosted it IIS.But want to where to apply conditions.Please help

    Friday, March 15, 2013 3:10 AM
  • User1283497924 posted

    Hi you can do one thing just schedule the job in with windows schedulor . and set execution only ones in a day.

    have a look of this links

    http://windows.microsoft.com/en-IN/windows7/schedule-a-task

    http://itexpertvoice.com/home/how-to-automatically-schedule-a-task-in-windows-7/

    Friday, March 15, 2013 3:19 AM
  • User-972560101 posted

    Try to write your code inside the below condition it will execute at the time every 10:10:10 Am 


    if DateTime.Now.ToString("hh:mm:ss tt") = "10:10:10 AM" then

    'Your code to write

    End if

    Friday, March 15, 2013 3:24 AM
  • User1283497924 posted

    Try to write your code inside the below condition it will execute at the time every 10:10:10 Am 


    if DateTime.Now.ToString("hh:mm:ss tt") = "10:10:10 AM" then

    'Your code to write

    End if

    In case if exection miss on that case how process is going to execute. and here requirement id application execution take place ones i a day.

    Friday, March 15, 2013 3:28 AM
  • User220959680 posted

    1. Console application, which acts as service Client 

    //Create an instance of WCFService proxy (service contract)
    <WCFServiceContract> client = new <WCFServiceContract>();
    client.Open();
    client.<Method that perform the operation>
    Client.Close();



    2. Windows scheduler (Programs >Task scheduler)  runs above Console app at specified intervals (Day with Time etc).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 15, 2013 7:28 AM
  • User2120624532 posted

    Log on as administrator.
    Open Task Scheduler by either typing "task" into the Start Menu search bar, or by opening All Programs - Accessories - System Tools.


    Select 'Create Basic Task' from the right hand pane and the 'Create Basic Task Wizard will open.

    Type a 'Name' and 'Description'  for your new task and click Next

    Select when you would like the event/task to run and click next. I am selecting daily.

    Select exact time when you want to run the application and click next.

    Select action and click next. I am selecting here Start a program.

    Click ‘Browse’ and select the exe file form the  folder and click next.
    Click Finish.

    For shortage of time I am providing here basic steps.
    To see step by step please visit: http://cybarlab.blogspot.com/2013/03/run-c-sharp-console-application-using.html

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 18, 2013 7:53 AM