Posts

Showing posts from November, 2011

Data Contracts & Serialization

Image
Introduction WCF Services and their clients depend on the exchange of data to accomplish any task. This section discusses how WCF handles data and data serialization. In general, a WCF service receives messages, processes them and sends messages back. For example, the following service contract accepts a message with information on the project name and returns a message that contains the project id: [ServiceContract] public interface IProject { [OperationContract] int GetProjectID( string projectname ) [OperationContract] void GetProjectDetails(int ID, out string manager, out DateTime dtStartDate, out DateTime dtEndDate); } Service Contracts Describing Messages This section explains the various ways in which messages can be described by an operation contract: Describing Messages Using Parameters Describing Empty Messages Describing Messages Using Message Contracts Describing Messages Using Streams Describing Messages Using Faults Describing Messages Using Derived Types Descri...