473,386 Members | 1,873 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,386 software developers and data experts.

POST from a windows Service

Hi,
This may be a stupid question but i'm just wondering if it is
possible to do a Http POST from a Windows Service (written in C#)

Thanks in Advance

Sep 20 '06 #1
2 2330
Yes, you will want to use the HttpWebRequest/HttpWebResponse classes in
your service.

Also, you will want to make sure that the service is running under an
account that has the appropriate permissions to access the network. The
LocalService account (which is what a lot of services run under) does not
have this permission.

On top of that, if you are writing a service to perform an action (like
a POST) on a timed interval, don't. Write your task as a console
application and then schedule that to run in Scheduled Tasks at your
interval.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<da*******@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Hi,
This may be a stupid question but i'm just wondering if it is
possible to do a Http POST from a Windows Service (written in C#)

Thanks in Advance

Sep 20 '06 #2

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:ev**************@TK2MSFTNGP02.phx.gbl...
| Yes, you will want to use the HttpWebRequest/HttpWebResponse classes in
| your service.
|
| Also, you will want to make sure that the service is running under an
| account that has the appropriate permissions to access the network. The
| LocalService account (which is what a lot of services run under) does not
| have this permission.
|

Sorry, but you got it wrong, the "allowed to access the network" in terms of
windows means access privileges to "network resources" like remote shares,
based on access token checks.
Webservers/services are just using TCP/IP sockets and accessing these do not
require an network access token (or simply put they aren't token based). If
what you say was true, you wouldn't be able to access the network using
sockets from a service account.

Willy.
Sep 20 '06 #3

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

Similar topics

3
by: Robb Gilmore | last post by:
Hello, We have a C#.NET app which runs as a windows service. Periodically it needs to post information via the internet to a remote server. For the posting, we are using HttpWebRequest class....
3
by: Andreas Kviby | last post by:
I have a HTML-form that I need to be able to POST from my VB.NET client application and store the resulting XML in a STRING or XML-document. This is the HTML-form code: <form name="form1"...
9
by: SP | last post by:
Hi All, I wrote a windows service which is supposed to stop after specified amount of time. I am calling OnStop() after specified time. OnStop() methods executed but I dont see the service...
1
by: Scott Davies | last post by:
Hi, I'm looking for some help on a small program that I'm trying to develop in VB.NET. I'm having trouble getting the code that I've written to work, can anyone shed some light as to where I'm...
8
by: Brandon | last post by:
I've yet to find a decently worded and exampled article outlining how one can perform more complex operations during MSI installation. Specifically, I'm looking to copy the source MSI to the...
4
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...
1
by: John Wolff | last post by:
I’m trying to upload a file to a Web Service. I have to submit the file using a standard HTML form with the <input type=“file” /tag. Ultimately, we are submitting the file from a Flash 8...
4
by: Thomas Eichner | last post by:
Hi, does anybody know a public website which offers a service that displays all data send by a browser (or an app calling the website), especially HTTP GET and POST data, browser data etc.? I...
2
by: =?Utf-8?B?TGlzYUNvbnN1bHQ=?= | last post by:
I have 2 web services and they are on different servers. I am supposed to POST a serialized XML document from one site to the other. I've looked around, but I'm totally confused. Can anyone...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.