Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Scheduling the start of a web service

Scheduling the start of a web service

Scheduled Pinned Locked Moved C#
tutorialquestion
14 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Pete OHanlon

    Web services don't start. They are pieces of code that are called from other processes (because they are implemented as DLLs). In order to accomplish this, you are going to need to write an application that calls this service and schedule it using the job scheduler.

    Deja View - the feeling that you've seen this post before.

    A Offline
    A Offline
    Albu Marius
    wrote on last edited by
    #3

    I wrote in my post that I have a solution for this issue and it seems that i wasn't far off. My mistake on the "start" word. Thank you for the reply.

    I am fighting against the Universe... Reference-Rick Cook

    N 1 Reply Last reply
    0
    • A Albu Marius

      I wrote in my post that I have a solution for this issue and it seems that i wasn't far off. My mistake on the "start" word. Thank you for the reply.

      I am fighting against the Universe... Reference-Rick Cook

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #4

      Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.


      only two letters away from being an asset

      L 1 Reply Last reply
      0
      • N Not Active

        Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.


        only two letters away from being an asset

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #5

        Mark Nischalke wrote:

        Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.

        :wtf: ????

        N 1 Reply Last reply
        0
        • L led mike

          Mark Nischalke wrote:

          Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time.

          :wtf: ????

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #6

          What's confusing you?


          only two letters away from being an asset

          L 1 Reply Last reply
          0
          • A Albu Marius

            Can somebody tell me how can I programatically start a web service at a given hour, or at least point me in the right direction. I have a web service that has to start every day at a given time, but I don't know how to schedule a new start.The web service can be started once to configure the daily hour to start again. My idea is to use a second service that monitors the time of day and starts the main service at the desired moment, but I'm not sure that this is the best idea to use.

            I am fighting against the Universe... Reference-Rick Cook

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #7

            If this is something that doesn't really return any kind of values, why is it even written as a web service?? What does this thing do??

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            • N Not Active

              What's confusing you?


              only two letters away from being an asset

              L Offline
              L Offline
              led mike
              wrote on last edited by
              #8

              Scheduling a WebService I suppose I don't know anything but that seems contradictory to anything remotely resembling "Best Practice". And wrapping it and using the windows scheduler just seems like more of the same.

              N 1 Reply Last reply
              0
              • L led mike

                Scheduling a WebService I suppose I don't know anything but that seems contradictory to anything remotely resembling "Best Practice". And wrapping it and using the windows scheduler just seems like more of the same.

                N Offline
                N Offline
                Not Active
                wrote on last edited by
                #9

                Didn't say anything about scheduling a webservice. Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time. How would you propose to do it?


                only two letters away from being an asset

                L 1 Reply Last reply
                0
                • N Not Active

                  Didn't say anything about scheduling a webservice. Wrap the webservice calls in an exe and use the Windows Scheduler to invoke the exe at the required time. How would you propose to do it?


                  only two letters away from being an asset

                  L Offline
                  L Offline
                  led mike
                  wrote on last edited by
                  #10

                  Mark Nischalke wrote:

                  How would you propose to do it?

                  Well certainly this could be misleading but the OP states it's "his" WebService:

                  Albu Marius wrote:

                  how can I programatically start a web service at a given hour

                  Albu Marius wrote:

                  I have a web service that has to start every day at a given time

                  Therefore he should have the code for "what" it actually does and then it seems the appropriate thing to do would be to build a Windows Service using that code. A WebService does not seem to apply at all in this situation. Again this is all based on what could be completely misleading statements by the OP.

                  1 Reply Last reply
                  0
                  • A Albu Marius

                    Can somebody tell me how can I programatically start a web service at a given hour, or at least point me in the right direction. I have a web service that has to start every day at a given time, but I don't know how to schedule a new start.The web service can be started once to configure the daily hour to start again. My idea is to use a second service that monitors the time of day and starts the main service at the desired moment, but I'm not sure that this is the best idea to use.

                    I am fighting against the Universe... Reference-Rick Cook

                    A Offline
                    A Offline
                    Albu Marius
                    wrote on last edited by
                    #11

                    Sorry for the late answer. It is my service and it doesn't return any values but does have to send some emails to certain people containing data at a given time of night. It has to do these operations when the server is not too busy. Now I implemented a System.Timers.Timer so that I can start the processing methods at 1 o'clock in the morning. In this case the service timer runs all day and calls the methods that process and send data. If someone can give me a better idea please try.

                    I am fighting against the Universe... Reference-Rick Cook

                    P 1 Reply Last reply
                    0
                    • A Albu Marius

                      Sorry for the late answer. It is my service and it doesn't return any values but does have to send some emails to certain people containing data at a given time of night. It has to do these operations when the server is not too busy. Now I implemented a System.Timers.Timer so that I can start the processing methods at 1 o'clock in the morning. In this case the service timer runs all day and calls the methods that process and send data. If someone can give me a better idea please try.

                      I am fighting against the Universe... Reference-Rick Cook

                      P Offline
                      P Offline
                      Pete OHanlon
                      wrote on last edited by
                      #12

                      If you are running SQL Server, then I would suggest that you create a task that sends the emails and use the SQL Server agent to manage this for you.

                      Deja View - the feeling that you've seen this post before.

                      A 1 Reply Last reply
                      0
                      • P Pete OHanlon

                        If you are running SQL Server, then I would suggest that you create a task that sends the emails and use the SQL Server agent to manage this for you.

                        Deja View - the feeling that you've seen this post before.

                        A Offline
                        A Offline
                        Albu Marius
                        wrote on last edited by
                        #13

                        Thanks for the advice but the task is far too complex for SQL Server because the emails have to be sent to a list of addresses that changes very often, the content of the emails is not the same and the scheduling for sending can be daily, monthly, yearly for each address. I decided to use timers and threads to accomplish this and also I have switched to a windows service instead of a web service.

                        I am fighting against the Universe... Reference-Rick Cook

                        P 1 Reply Last reply
                        0
                        • A Albu Marius

                          Thanks for the advice but the task is far too complex for SQL Server because the emails have to be sent to a list of addresses that changes very often, the content of the emails is not the same and the scheduling for sending can be daily, monthly, yearly for each address. I decided to use timers and threads to accomplish this and also I have switched to a windows service instead of a web service.

                          I am fighting against the Universe... Reference-Rick Cook

                          P Offline
                          P Offline
                          Pete OHanlon
                          wrote on last edited by
                          #14

                          Albu Marius wrote:

                          the task is far too complex for SQL Server because the emails have to be sent to a list of addresses that changes very often, the content of the emails is not the same and the scheduling for sending can be daily, monthly, yearly for each address

                          So store the addresses and frequency in a table. Really - it's not too complex for SQL Server - after all, you are working with data here. Don't try to overcomplicate things - step back a second and take another look at the architecture.

                          Deja View - the feeling that you've seen this post before.

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups