Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Self running timer on Webservice??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christina Haller - 11 Feb 2005 10:47 GMT
Hi
Is it possible to do something like that:
1. there is a file located on my website
2. I would like to start a webservice that copies that file each 24 hours to
a backup dir on the website
3. The webservice should be self running (without a client connection)

Until now, I tried the following stuff, but the timer does not run when i
call the method starttimer! I was thinking that the modal variable mVal will
count up on each timer_tick and the stoptimer returns then the amount of
ticks done. But nothing comes back.

Any idea?? Thanks

1. Builded a webservice containing 2 Methods and 1 Timer
Public mVal As Long

<WebMethod()> _

Public Function StartTimer() As String

Timer1.Interval = 1000

Timer1.Start()

StartTimer = CStr(mVal)

End Function

<WebMethod()> _

Public Function StopTimer() As String

Timer1.Stop()

StopTimer = CStr(mVal)

End Function

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

mVal = mVal + 1

End Sub
Dan Rogers - 15 Feb 2005 21:53 GMT
This isn't going to work.  What you may want to consider is creating an NT
service to do this - as this is more closely suited to the kinds of things
you would choose service instead of web-service to do.

Web services are stateless - so a call to one method won't carry over to
the next method call.  If enough time passes, the thread will time out.  In
fact, if you are just creating a normal time on a web service thread, and
then returning, when that thread is reharvested, it's timer will get
orphaned (and eventually croak).

--------------------
>From: "Christina Haller" <codegen@gmx.net>
>Subject: Self running timer on Webservice??
[quoted text clipped - 10 lines]
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:5490
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 43 lines]
>
>End Sub
Christina Haller - 17 Feb 2005 14:45 GMT
Ok, that was what i assumed.
Because the webserver is not mine, I cant install any software on it.
But if found another solution for doing my (automated) backup.

Thanks anyway.

> This isn't going to work.  What you may want to consider is creating an NT
> service to do this - as this is more closely suited to the kinds of things
[quoted text clipped - 72 lines]
>>
>>End Sub
taliesin77 - 23 Feb 2005 07:41 GMT
> *Ok, that was what i assumed.
> Because the webserver is not mine, I cant install any software on
[quoted text clipped - 4 lines]
>
> *

What was the other solution you found? I tried creating a pair of
webservices that accept a target URI to "signal" every given period for
a given total duration.  These two services pass the state info back and
forth in their arguments and then send a "signal" (request) to wake up
the main web service.  While the ping-ponging works, my threads still
randomly die (sometimes a few minutes, sometimes after 40 minutes of
ping-pong

Hopefully you found something else that works cause I am getting pretty
frustrated with having my threads just die.


Christina Haller - 08 Mar 2005 15:14 GMT
> What was the other solution you found? I tried creating a pair of
> webservices that accept a target URI to "signal" every given period for
[quoted text clipped - 6 lines]
> Hopefully you found something else that works cause I am getting pretty
> frustrated with having my threads just die.

I could not find a solution for the webservice.After I brought down my
Webspace Provider once :-s, I changed the approach. Instead of having a
continuosly running service on the webserver, I create my backup of the
database when the first user (per day) is login in to the application and
send via email to my workplace;-). That means, if someone changes data,
automatically the database has been saved once per day.

That replaces my need of the webservice.

Until now, I couldnt figure out the webservice stuff. It's really
complicated, but I think it has to do with the asynchronous call of the
webservice. If I find a solution, I'l post it here of course.

cheers
c.

> --
> taliesin77
> ------------------------------------------------------------------------
> Posted via http://www.codecomments.com
> ------------------------------------------------------------------------

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.