Im using C# as my development language. However I have some confusion over HTTPListener and a web service. Can you please explain what are the differences and advantages and possibly a situation in which you would use either
HttpListener is a .NET class dedicated to listening for HTTP requests. You might use it if you are interested in dealing with low-level HTTP communications.
A web service will usually be a project containing several classes that implement some sort of business functionality. The part that actually listens to HTTP is typically going to be abstracted away from your code-- the ASP.NET runtime deals with the messy details, mapping HTTP requests onto handlers (classes that you write) which then deal with the business logic in a more abstract way.
If you work with HttpListener, you will have to parse your own requests and format your own responses. If you build a web service project, the requests are translated into method calls with arguments, so you only have to worry about programming c# classes.