Creating a New Service from Scratch
You’re about to be introduced to the WCF service. This lab isn’t your typical “Hello World”—it’s “Hello Indigo”! In this lab, you will learn how to build a new WCF service and in the process learn the minimum requirements of service development and consumption. Here’s a short list of things you’ll accomplish:
Create a new service contract and service implementation
Programmatically configure a service host, its endpoints, and bindings
Create a client application and open a client channel proxy to invoke the service
Now, before you start thinking “been there, done that,” this simple lab will be slightly
different because I’m going to give you some practical design tips that ensure
configurability and appropriate decoupling of service, host, and client. In addition, I’ll
be diving deeper into basic concepts such as services, service contracts, endpoints,
bindings, ServiceHost, and channels.
Lab: Creating Clients and Services Programmatically
In this first lab, you will create a new solution with three projects: a service, a host, and a client. When you run the service host, you’ll expose a single service endpoint. The client application will access service operations through that endpoint. You’ll host the service in a console application and invoke the service using a manually constructed proxy. This lab will teach you the basic requirements for creating, hosting, and consuming a service with WCF.
Creating a new service
The first thing you will do is create ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access