WCF - Terms


WCF - Terms

Concepts and terms used with WCF Service are discussed below.

Message :

  •   It is a self-sufficient data unit with a header, a message body and other numerous parts.

Service :

  • A program to expose one or more service operations via endpoints.

Endpoint :

  • Endpoint is a construct with ABC via which messages are sent or received in both directions. 
  • The ABC denotes the following:
    • a location (an address - A) : Defines where messages can be sent.
    • a mechanism (a binding - B) : Specification of the communication to explain how the messages should be sent.
    • a definition (a contract - C) : For a set of messages that can be sent or received (or both) at that location that describes what message can be sent.

Application Endpoint :

  • An endpoint of an application that is used to access a service contract.

Infrastructure Endpoint :

  •  An Endpoint of an infrastructure is used to provide the information about  a structure such as metadata information.

Address :

  • It specifies the location of the messages.
  • It is stated that it is in the form of Uniform Resource Identifier (URI).
  • The URI has 
    • A schema part to mention the protocol such as HTTP or TCP.
    •  A hierarchical part to mention location based on HTTP or TCP.

Binding :

  • Binding defined as a communication methodology of an endpoint. 
  • It builds a framework with a set of components termed as binding elements to focus on message security and message arrangements.
  • The elements of the binding are arranged as a "stack".
  • The binding also specifies the transport protocol and the encrypting standards. 

Binding Element :

  • It signifies as a part of the binding such as a transport protocol, an encrypting standard, an application of reliability and component for communication in stack.

Behaviors :

  • An element is used control run-time features of a service, an endpoint of a particular operation, or a client. 
  • Behaviors are collected such as,
    • Common Behaviors - have an impact on all global endpoints.
    • Service Behaviors – have an impact only on service-related features.
    • Endpoint Behaviors - have an impact only on endpoint-related things, and 
    • Operation-Level Behaviors - affect particular operations. 

System Provided Bindings:

  • It is a collection of binding elements that save time, by offering enhanced bindings according to the scenario. 

Configuration Versus Coding :

  • Application Control is achieved via coding or configuration, or both as follows:

S.No

Coding

Configuration

1.

Code is written and compiled.

Configuration allows its user to set client and service parameters without code recompile.

2.

Coding allows the developer to preserve his/her control over all constituents of the service or client.

Configuration permits to set principles like endpoint addresses

3.

Any settings performed by configuration can be reviewed and overruled by the code.

Configurations permits to add endpoints, bindings, and behaviors.

Service Operation :

  • A process that is a part of services code to define an operation. 
  • The operations are exposed to clients in the form of methods.
  • The method can be:
    • Have or does not have arguments
    • May or may not return a value

Service Contract :

  • It is a combination of multiple related operations into a single functional unit. 
  • It defines the following service-level settings: 
    • the namespace of the service and
    • a corresponding callback contract etc. 

Operation Contract :

  • An Operation Contract describes the arguments and return type of an operation. 
  • The Operations can be demonstrated as 
    • taking as input, a single message and returning a single message.
    • taking as input a set of types and returning a type.

Message Contract :

  • Message Contract describes the message format how to be.

Fault Contract :

  • It signifies the errors from an operation for returning to the caller. 
  • An Operation may have zero or more errors defined in the form of exceptions.

Data Contract :

  • The metadata description data types used by a service is termed as data contract
  • Data contracts are created for complex data types to enables users to easily inter-operate with the service. 

Hosting :

  • A host is an application and it is used to control the lifetime of the service. 
  • Services generally being self-hosted or hosted by another application’s process.

Self-Hosted Service :

  • A service running inside an application’s process. 
  • The application developer holds control on  
    • The lifetime of the service, 
    • The properties of the service, 
    • Opening of the service, and 
    • Closing of the service. 

Hosting Process :

  • A hosting process is an application for hosting and controlling following services:
    • Internet Information Services (IIS), 
    • Windows Activation Services (WAS) and 
    • Windows Services. 

Instancing :

  • A service can possess three forms of instancing as per the  applications choice:
    • single - a single runtime object to service all the clients.
    • per call - a new runtime object is created to manage each client call; 
    • per session - a set of runtime objects are created, one for each session for a single client. 

Client Application :

  • Client Application is used to access services via endpoints.
  • Exchanges messages are creating WCF Client instance to call the WCF Client methods. 

Channel :

  • A channel is an implementation that joins with a binding element.
  • Channels pile on top of each other and forms the channel stack.

WCF Client :

  • A WCF client exposes the service operations in the form of methods.
  • An application that host a WCF client as well as hosting a WCF service
  • An application can be created as a service that contains one or more WCF clients of other services.
  • The Service Model Metadata Utility Tool (Svcutil.exe) automatically generates a WCF Client and points it to a running service.

Metadata :

  • Metadata defines service characteristics to the external world. 
  • Metadata generates WCF clients and configurations by accessing the Service Model Metadata Utility Tool (Svcutil.exe).
  • Metadata contains 
    • ML schema - describes the data contract of the service.
    • WSDL – Web Services Description Language describes the service methods.
  • Service and its endpoints are analyzed to automatically generate metadata. 
  • Metadata behavior is initiated to publish metadata to the clients.

Security :

  • Security includes 
    • Message Privacy –way of encryption
    • Reliability –way of tamper detection
    • Verification and Validation - validating and authorizing message access with security mechanisms over HTTP.

Transport Security Mode :

  • It describes the privacy, reliability, and validations at the transport layer.
  • Advantage is that there is performance improvement. 
  • The disadvantage is that the security application at each level of communication makes it more prone to errors.

Message Security Mode :

  • Ensures message security in the form of SOAP Message Security during its transit. 
  • Enables the message receiver to identify the message damage and provide according decryption. 
  • Hence security is compressed with every message along with various credentials. 
  • The only drawback with this approach is the density of the cryptographic tools that affects the performance.

Transport with Message Credential Security Mode :

  • Talks about the transport layer providing privacy, verification, and reliability for messages with multiple security credentials.

WS-* :

  • WS-* denote extended Web Service (WS) specifications such as WS-Security, WS-Reliable Messaging  and much more that are associated with WCF.