What is a service contract ( In WCF) ?


In every service oriented architecture, services share schemas and contracts, not classes and types. What this means is that you don't share class definitions neither any implementation details about your service to consumers.

Everything your consumer has to know is your service interface, and how to talk to it. In order to know this, both parts (service and consumer) have to share something that is called a Contract.

In WCF, there are 3 kinds of contracts: Service Contract, Data Contract and Message Contract.

A Service Contract describes what the service can do. It defines some properties about the service, and a set of actions called Operation Contracts. Operation Contracts are equivalent to web methods in ASMX technology

No comments:

Post a Comment