Monday, September 3, 2012

Quick WCF




WCF Basics

WCF Service (Item Template)
 - adds reference to System.ServiceModel
 - adds Interface file IService.cs with ServiceContract and Operation COntract
 - adds app.config file with Service Host EndPoint details that can be declaratively configured. Address, Binding and Contract

A Service must be hosted inside a process that allows it to run inside an Application Domain
 - move the above config file to this project
 - Configure the End Point, either programmatically or declaratively, specify a base address for the host, Meta data binding and make the metadata accessible through HTTP as WSDL


Client-side story:
The published Service gives a WSDL which is accessible on the HTTP
- Either use svcutil.exe to generate a class file and a config file that act as a proxy layer in order for it to consume the service

OR

add the "Web Service Reference" to the client which will automatically generate the proxy

No comments:

Post a Comment