EnjoySharePoint YouTube Channel


In this post, we will discuss ABC of WCF. You can also check out my previous posts on:
ABC of WCF composed of Address, Binding, Contract.
The endpoints specify an Address that defines where the endpoint is hosted. It’s basically a url.
The endpoints also define a binding that specifies how a client will communicate with the service and the address where the endpoint is hosted.
Different types of bindings supported in WCF:
NetPeerTcpBinding etc.
The endpoints specify a Contract that defines which methods of the Service class will be accessible via the endpoint; each endpoint may expose a different set of methods.
Different contracts in WCF:
Service Contract
Data Contract
Message Contract
Fault Contract
Service Contract:
Service contracts describe the operation that service can provide. For Eg, a Service provides to know the temperature of the city based on the zip code, this service is called as Service contract. It will be created using the Service and Operational Contract attribute.
Data Contract:
Data contract describes the custom data type which is exposed to the client. This defines the data types, which are passed to and from service. Data types like int, string are identified by the client because it is already mentioned in XML schema definition language document, but custom created the class or data types cannot be identified by the client e.g. Employee data type. By using Data Contract we can make the client be aware of Employee data type that is returning or passing a parameter to the method.
Message Contract:
Default SOAP message format is provided by the WCF runtime for communication between Client and service. If it is not meeting your requirements then we can create our own message format. This can be achieved by using Message Contract attribute.
Fault Contract:
Suppose the service I consumed is not working in the client application. I want to know the real cause of the problem. How can I know the error? For this, we are having a Fault Contract. Fault Contract provides a documented view of error occurred in the service to the client. This helps us to easy identity, what error has occurred.
Check out Best Alternative to InfoPath -> Try Now
You May Also like the Following SharePoint Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →