21 September, 2009

.Net Framework 3.0 FAQ

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


In terms of WCF, What is a message?
A message is a self-contained unit of data that may consist of several parts, including a body and headers.


In terms of WCF, What is a service?
A service is a construct that exposes one or more endpoints, with each endpoint exposing one or more service operations.


In terms of WCF, What is an endpoint?
An endpoint is a construct at which messages are sent or received (or both). It comprises a location (an address) that defines where messages can be sent, a specification of the communication mechanism (a binding) that described how messages should be sent, and a definition for a set of messages that can be sent or received (or both) at that location (a service contract) that describes what message can be sent.

An WCF service is exposed to the world as a collection of endpoints.


In terms of WCF, What is an application endpoint?
An endpoint exposed by the application and that corresponds to a service contract implemented by the application.


In terms of WCF, What is an infrastructure endpoint?
An endpoint that is exposed by the infrastructure to facilitate functionality that is needed or provided by the service that does not relate to a service contract. For example, a service might have an infrastructure endpoint that provides metadata information.


In terms of WCF, What is an address?
An address specifies the location where messages are received. It is specified as a Uniform Resource Identifier (URI). The schema part of the URI names the transport mechanism to be used to reach the address, such as "HTTP" and "TCP", and the hierarchical part of the URI contains a unique location whose format is dependent on the transport mechanism.


In terms of WCF, What is binding?
A binding defines how an endpoint communicates to the world. It is constructed of a set of components called binding elements that "stack" one on top of the other to create the communication infrastructure. At the very least, a binding defines the transport (such as HTTP or TCP) and the encoding being used (such as text or binary). A binding can contain binding elements that specify details like the security mechanisms used to secure messages, or the message pattern used by an endpoint.

No comments: