473,771 Members | 2,372 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. "refreshDat a").

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 2185
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. "refreshDat a").

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
15550
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# application. The command runs successfully from a Windows Form but fails if the application is recasted as a Windows service. The application is essentially a File Watcher that should run the process when a file is dropped into a specific directory. ...
3
4797
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 ServiceController to check that the Service on the specified machine is running, can I get the DataSet that is held within the Service? Is it possible to create Properties or have a function that returns the DataSet? Kind Regards,
12
5342
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 the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
2
1447
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 profile: Choice-1: call the web service and retrieve all 100 users profile (with a single thread); Choice-2: start 100 thread, each thread retrieve one user profile.
1
1226
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 HttpWebResponse.GetResponseStream() to retrieve the data as a stream. I put this stream into a MemoryStream, and I use a StreamReader object to read the contents and write to a temp file on the local system.
5
5043
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 that calls the web service to render a vertical strip of images. After doing some research I am unable to find some vb.net code that can assist in what I want to achieve. The closest thing I found was
3
3139
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 reference a "name and address web service," which gives me validation lists for name honorifics (e.g. Dr, Mr, Miss, Mrs), name suffixes (e.g. Sr, Jr, III), and City/State/ZIP combos. The same name and address web service also can save and retrieve...
1
1302
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 the data to me over SOAP, as it's a nice clean interface. The issue is that I need to have a thread running in the background which sets up the SMS hardware (com port, etc) and waits for incoming data from the web methods. I tried doing this...
1
1772
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 how to tell the service where the .exe actually resides on the server. I would like to prevent hard-coding it since the software will be distributed to different offices in my company.
0
9619
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.