POST from a windows Service

D

davidfahy

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
 
N

Nicholas Paldino [.NET/C# MVP]

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

Willy Denoyette [MVP]

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

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