Running a web service from a Windows Service program

J

JohnSouth

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
 
V

Vadym Stetsyak

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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.
 
G

Guest

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
 
J

JohnSouth

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
 
V

Vadym Stetsyak

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 ::cool:.
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
 
L

Leon Friesema

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

Him

JohnSouth said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top