WebServiceHost : Hosting a WCF REST Service

Objective

In this article, I will explain

1. What is WebServiceHost Factory class?

2. What is its function?

3. Where to use it?

4. One sample on hosting WCF REST Service using WebServiceHost.

What is WebServiceHost factory?

1. This is useful to host WCF REST End points.

2. This is derived from ServiceHost.

3. WebServiceHost has some extra functionality.

4. WebServiceHost works exactly the same way ServiceHost works.

WebServiceHost factory perform following special task

image

Where to use it?

image

How to choose between ServiceHost and WebServiceHost?

image

Example

In this example, I will show you step by step, how we can create a REST Service and host it in a console application using WebServiceHost factory.

To see the complete step by step walkthrough , follow my below article.

Hosting WCF REST Service in Console Application.

I hope this post was useful. Thanks for reading. Happy coding.


Discover more from Dhananjay Kumar

Subscribe to get the latest posts sent to your email.

Published by Dhananjay Kumar

Dhananjay Kumar is founder of NomadCoder and ng-India

One thought on “WebServiceHost : Hosting a WCF REST Service

Leave a comment

Discover more from Dhananjay Kumar

Subscribe now to keep reading and get access to the full archive.

Continue reading