473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Running a web service from a Windows Service program

Hi

My application needs to get XML files from another system at irregular
intervals. I'm looking at running a c# program on my server as a
Windows Service that uses a .Net Web Service to request the latest
files at regular intervals (maybe each hour).
As I'm new to web services I'd like to ask if this is a sensible way to
use web services? And to ask for any tips, or maybe there's a better
way of getting files between systems.

John South

www.wherecanwego.com
Pangbourne UK

Mar 1 '06 #1
7 1523
Hello, JohnSouth!

J> My application needs to get XML files from another system at irregular
J> intervals. I'm looking at running a c# program on my server as a
J> Windows Service that uses a .Net Web Service to request the latest
J> files at regular intervals (maybe each hour).
J> As I'm new to web services I'd like to ask if this is a sensible way to
J> use web services? And to ask for any tips, or maybe there's a better
J> way of getting files between systems.

You can use simple network I/O if the only thing you want is sending files, something like sockets ( System.Net.Sockets ) can do for you.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Mar 1 '06 #2
Hi,

If all you need is to transfer a file consider using a network connection,
you can run both server and client as a window service, in addition you
could even zip the file to decrease the network traffic.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"JohnSouth" <Jo**********@gmail.com> wrote in message
news:11*********************@j33g2000cwa.googlegro ups.com...
Hi

My application needs to get XML files from another system at irregular
intervals. I'm looking at running a c# program on my server as a
Windows Service that uses a .Net Web Service to request the latest
files at regular intervals (maybe each hour).
As I'm new to web services I'd like to ask if this is a sensible way to
use web services? And to ask for any tips, or maybe there's a better
way of getting files between systems.

John South

www.wherecanwego.com
Pangbourne UK

Mar 1 '06 #3
To get data from WebService you need to use HttpWebRequest/Respone to read
the response back as a stream of data.
My application needs to get XML files from another system at irregular
intervals. I'm looking at running a c# program on my server as a
Windows Service that uses a .Net Web Service to request the latest
files at regular intervals (maybe each hour).
As I'm new to web services I'd like to ask if this is a sensible way to
use web services? And to ask for any tips, or maybe there's a better
way of getting files between systems.


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Mar 1 '06 #4
Hi Both

Thanks for the replies. Can I set up a network connection if the only
contact with the other machine is using http ot https over the public
internet?

John South
www.wherecanwego.com
Pangbourne UK

Mar 1 '06 #5
On 1 Mar 2006 07:33:41 -0800, "JohnSouth" <Jo**********@gmail.com>
wrote:
Hi Both

Thanks for the replies. Can I set up a network connection if the only
contact with the other machine is using http ot https over the public
internet?

John South
www.wherecanwego.com
Pangbourne UK


For that you could beter use a WebService or Remoting (allthough I'd
recommend WS for this)

Leon
Mar 1 '06 #6
Hello, JohnSouth!

J> Thanks for the replies. Can I set up a network connection if the only
J> contact with the other machine is using http ot https over the public
J> internet?

Of course you can :8-).
You can use HttpWebRequest/HttpWebResponse or WebClient to send a request to server and get your file.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Mar 1 '06 #7
Him

"JohnSouth" <Jo**********@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
Hi Both

Thanks for the replies. Can I set up a network connection if the only
contact with the other machine is using http ot https over the public
internet?


If this is the case then you have to change your selection, a TCP
connection is not the best way, in this case WebRequest/Response is your
answer ,it's as easy as the other way (from the client perspective)
It does change the server side though, you will have to use a web app to
server the files (very easily done too)

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Mar 1 '06 #8

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

Similar topics

8
by: Jonathan Heath | last post by:
Hi all, I have created an ASP script that enters data into an Access Database. My problem is that I'd like this script to run when the computer is shutdown or the user logs off. I think...
2
by: Raj Sandhu | last post by:
I am running a simple .NET program, which is being executed by a windows service and I am coming across the error -532459699. I have tried the following: Ran the service using the system id and...
1
by: Peter Rilling | last post by:
I have an EXE that I would like to be able to run from either the command-line or as a windows service. Is there a way that I can tell which context the program is running in? Basically, if it...
4
by: duzinga | last post by:
I am trying to have a server program that runs at startup and accepts several commands from the clients. One of the commands is to play an audio file. I am using...
14
by: William LaMartin | last post by:
If I have a Windows application with no form--only a module that starts with sub main and which has a system timer, in the elapsed event of which I want to run some code, how can I keep this...
2
by: Mike | last post by:
Can a vb program running as a serice not use network paths to do file/io? I can't seem to get my program to work with network paths and files. When I use local disk it works fine. When I run it...
12
by: tshad | last post by:
What would be a good way to check programmatically whether a service was running? We have a service that dies periodically and I need to check to see if this service is running. I know how to...
0
by: Laszlo Nagy | last post by:
Hi All! There was a thread here, more than a month ago. It was about finding the path of a .py file. I suggested os.abspath(__file__). Others told that sys.argv is better. I was not sure why I...
6
by: DM | last post by:
Hi All, I have written a server program which distributes real-time data to our customers and is also used by our customers to redistribute this data over their internal networks. The program is...
12
by: Shadlan | last post by:
Hi. I need to know if a service is running on my server. Is there any PHP instruction that I can use to do this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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
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
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,...
0
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
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...
0
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,...

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.