Message & Channel
Message is unit of data exchange between client and service. Message has several parts including body and headers.
WCF Runtime
Set of objects responsible for sending and receiving message, like formatting, applying security , transmitting and receiving message by applying various protocol.
Channels
This defines how message is transmitted to and from endpoint
- Transport Channel - Handles sending & receiving message from network. Protcols like Http, TCP etc.
- Protcol channel- Implements SOAP based protocol by processing and possibly modifying message.
WCF Client
An application desired to consume or use a service needs a client to do so.
Step 1 Get proxy class and endpoint details
This creates a class and configuration file
Step 2 Call Operation
Add class created above to application, create an object , invoke the method.
When the client application calls the first operation, WCF automatically opens the underlying channel. This underlying channel is closed, when the object is recycled.
Step 3 Close Wcf Object/client
Metadata
Characteristics of the service are described by the metadata. This metadata can be exposed to the client to understand the communication with service. Metadata can be set in the service by enabling the ServiceMetadata node inside the servcieBehaviour node of the service configuration file.
<system.serviceModel> <services> <service name="MathService" behaviorConfiguration="MathServiceBehavior"> <endpoint address="" contract="IMathService" binding="wsHttpBinding"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MathServiceBehavior"> <serviceMetadata httpGetEnabled="True"/> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>