WCF Flashcards
message
A self-contained unit of data that can consist of several parts, including a body and headers.
service
A construct that exposes one or more endpoints, with each endpoint exposing one or more service operations.
endpoint
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 describes how messages hold 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.
application endpoint
An endpoint exposed by the application and that corresponds to a service contract implemented by the application.
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.
Example: A service might have an infrastructure endpoint that provides metadata information.
address
specifies the location where messages are received. It is specified as a Uniform Resource Identifier (URI). The URI schema part names the transport mechanism to use to reach the address, such as HTTP and TCP. The hierarchical part of the URI contains a unique location whose format is dependent on the transport mechanism.
Example: HTTPS://cohowinery:8005/ServiceModelSamples/CalculatorService
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 security mechanism used to secure messages, or the message pattern used by an endpoint.
binding element
Represents a particular piece of the binding, such as a transport, an encoding, an implementation of an infrastructure-level protocol (such as WS-ReliableMessaging), or any other component of the communication stack.
behaviors
A component that controls various run-time aspects of a service, an endpoint, a particular operation, or a client. Behaviors are grouped according to scope: common behaviors affect all endpoints globally, service behaviors affect only-service-related aspects, endpoint behaviors affect only endpoint-related properties, and operation-level behaviors affect particular operations.
Example: one service is throttling, which specifies how a service reacts when when an excess of messages threaten to overwhelm its handling capabilities. An endpoint behavior, on the other hand, controls only aspect that are relevant to endpoints, such as how and where to find a secret credential.
system-provided bindings
WCF includes a number of system-provided bindings. These are collections of binding elements that are optimized for specific scenarios. For example, the WSHttpBinding is designed for interoperability with services that implement various WS-* specifications. These predefined bindings save time by presenting only those options that can be correctly applied to the specific scenario. If a predefined binding does not meet your requirements, you can create your own custom binding.
configuration versus coding
Control of an application can be done either through coding, through configuration, or through a combination of both. Configuration has the advantage of allowing someone other than the developer (for example, a network administrator) to set client and service parameters after the code is written and without having to recompile. Configuration not only enables you to set values like endpoint addresses, but also allows further control by enabling you to add endpoints, bindings, and behaviors. Coding allows the developer to retain strict control over all components of the service or client, and any settings done through the configuration can be inspected and if needed overridden by the code.
service operation
A procedure defined in a service’s code that implements the functionality for an operation. This operation is exposed to clients as methods on a WCF client. The method can return a value, and can take an optional number of arguments, or take no arguments, and return no response. For example, an operation that functions as a simple “Hello” can be used as a notification of a client’s presence and to begin a series of operations.
service contract
Ties together multiple related operations into a single functional unit. The contract can define service-level settings, such as the namespace of the service, a corresponding callback contract, and other such settings. In most cases, the contract is defined by creating an interface in the programming language of your choice and applying the ServiceContractAttribute attribute to the interface. The actual service code results by implementing the interface.
operation contract
An operation contract defines the parameters and return type of an operation. When creating an interface that defines the service contract, you signify an operation contract by applying the OperationContractAttribute attribute to each method definition that is part of the contract. The operations can be modeled as taking a single message and returning a single message, or as taking a set of types and returning a type. In the latter case, the system will determine the format for the messages that need to be exchanged for that operation.
message contract
Describes the format of a message. For example, it declares whether message elements should go in headers versus the body, what level of security should be applied to what elements of the message, and so on.