Before we get stuck into a full scale example, I’ve prepared a simple checklist of tasks required to get a basic service up and running.
Refer to this checklist to get your first WCF solutions up and running quickly.
Service & (Host)
- Service Contract IMyServiceContract
- Implementation of that Contract
- Service Proxy Implementing ServiceContract & ClientBase<IMyServiceContract>
- Endpoints via App.Config
- Form/Console to kick off Host
- Proxy implementing IMyServiceContract
- Endpoints to match those specified in service via App.config
If you haven’t done things right one of the very early exceptions you might receive is an InvalidOperationException and it will name the Contract that you haven’t implemented correctly. This is likely to be caused by a flaw in your app.config (server side).
Other exceptions to look out for are those when you attempt to call the service and either endpoints are misconfigured or implementations aren’t complete.