473,508 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can a Web Service retrieve data in background?

Hello,

I'm new to Web Services.
I'm trying to develop a Web Service that retrieves some data out of a
database and sends them to the client as a DataSet when a method is invoked.
My question is: Is it possible to run another method on the Web Service
automatically to refresh the data? That means the Web Service should interact
as a Windows Service after a certain amount of time it should retrieve the
data and stores them locally, and when a Client is connection it always gets
the data from the local source (i.e. XML file), not from the database, so the
Client doesn't have to wait until the data is available. Only the Web Service
refreshes the data in the background (without any Client invokement).

I don't know if this would be possible but I think it isn't. My guess is
that I would write a Windows Service which queries the Web Service to refresh
the data.
But how can I solve this?
I would prefer that the Windows Service gets a dynamic list of Web Services
it should refresh. So I will have to set dynamic references to these Web
Services (not in the IDE "Add Web Reference") but the invoked method could
probably always be the same (i.e. "refreshData").

Does anybody know how I can solve this?
Can I simply add a timer to the Web Service? I don't think it will work.

Thank You in advance

Best regards
Sven
Nov 23 '05 #1
3 2168
Hi,

You haven't mentioned anything about the clients of your webservice. And,
also, what makes to think that response from DB server will be slow?

If all your clients on same domain / lan, as your webservice, getting the
response direct from your DB server shouldn't make much time at all.

if you still want to keep a local copy (a xml file) for the web service to
use, then create a scheduled job on the DB server to update this xml file. do
not disturb the web service will any service or timer.

--
The Clipper
"Asus" wrote:
Hello,

I'm new to Web Services.
I'm trying to develop a Web Service that retrieves some data out of a
database and sends them to the client as a DataSet when a method is invoked.
My question is: Is it possible to run another method on the Web Service
automatically to refresh the data? That means the Web Service should interact
as a Windows Service after a certain amount of time it should retrieve the
data and stores them locally, and when a Client is connection it always gets
the data from the local source (i.e. XML file), not from the database, so the
Client doesn't have to wait until the data is available. Only the Web Service
refreshes the data in the background (without any Client invokement).

I don't know if this would be possible but I think it isn't. My guess is
that I would write a Windows Service which queries the Web Service to refresh
the data.
But how can I solve this?
I would prefer that the Windows Service gets a dynamic list of Web Services
it should refresh. So I will have to set dynamic references to these Web
Services (not in the IDE "Add Web Reference") but the invoked method could
probably always be the same (i.e. "refreshData").

Does anybody know how I can solve this?
Can I simply add a timer to the Web Service? I don't think it will work.

Thank You in advance

Best regards
Sven

Nov 23 '05 #2
Hello Bala,

Thank you for your answer. The clients of my WebService will be ASP.NET
WebSites and Smart Clients or .Net Applications. Now we have a set of VB6
programs, sometimes they always do the same calculations or retrieve the same
data out of the DB. So it would be better to use a WebService instead, the
data will be retrieved only once and all Client Apps can use this data.

The response from DB Server sometimes is slow, for instance calling very
huge SELECTs or Procedures (we already have), so it would be *very* bad if
the Client has to wait until the SELECT finishes (then there is no need for a
WebService in my opinion, even if it's called asynchronously I will have to
wait until the data is available).

Yes, the client Apps will mostly work within the same LAN / domain as the DB
Server and WebServer.

But I would like to use the advantages of WebServices in my client Apps,
i.e. there is no need to connect to the DB for my client App, because the
Service already has retrieved the data.

I think about a possibility to schedule a WebService to run at a particular
time and retrieve some data from a Stored Procedure, saves them and sends
them to the client when the client needs it.

Thank You.

Sven
Nov 23 '05 #3
Hi,

I've found out the solution.
I simply added a Timer to my WebService and invoked
a method that starts the Timer.

So, my WebService retrieves Data every n Seconds and
stores it in the local File System as a GZipped File.

I did not think that it could be that easy.
:)

Best regards
Sven

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
15504
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
3
4782
by: Steve Amey | last post by:
Hi all Is it possible to retrieve data from a Windows Service? Let's say I have a service that contains code in the OnStart method that creates a DataSet, from a client application I'm using a...
12
5292
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
2
1433
by: Polaris | last post by:
Hi Experts: I have a web service which retrieves user profile from Active Directory and a Database. Just wonder, which one is better way to use the web service if I need to retrieve 100 users...
1
1210
by: cjohnson275 | last post by:
Hi, I have some code that uses HttpWebRequest to request data from an Internet site, performaing a "screen-scraping" of an html page textual data. I then use the...
5
5016
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
3
3119
by: =?Utf-8?B?Q3JhaWc=?= | last post by:
Background: I am building a Windows enterprise application that has separate assemblies for UI, business logic/rules, and data access (i.e. typical N-tier architecture). Many of the assemblies...
1
1294
by: =?Utf-8?B?RGFycmVsbCBIb2xpZ2Fu?= | last post by:
I'm writing an application that needs to take data from an outside app and send the data in an SMS message. I was hoping to use a C# web method to allow the outside (client) application to send...
1
1759
by: jehugaleahsa | last post by:
Hello: I wrote an .exe that I would like to be called by a service I am deploying to a server. However, I am not sure how to tell the setup project to include the .exe. Also, I do not know...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7042
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5052
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.