Blog Home  Home Feed your aggregator (RSS 2.0)  
Software Code Help blogs - Interview Question WCF
newtelligence powered
 
 Thursday, June 26, 2008

WCF contracts define the structure of things.  There are three types of contracts:

·         Service Contract: A service contract defines what it does.  A service can have one or more service contracts.  Service contracts are similar to interfaces in Object Oriented Programming.  You implement an interface for your service logic.  For example, a service that operates as a calculator may have an ICalculator contract with four functions for add, subtract, multiply and divide and implements this interface in Calculator class.

·         Data Contract: Data contracts let you to pass custom objects to service operations.  Using data contracts you define a structure for your objects and pass them to methods.  For example, you may have a Person class that you the Person to be able to pass it to methods.

·         Message Contract: This is less common than previous contract types, but you can use message contracts to change the structure of your messages to use them in your application.  For example, you can change the body of a message.

Thursday, June 26, 2008 5:53:28 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question WCF  | 
Copyright © 2009 Software Code Help. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: