21) Mention what are the various address format in WCF?
The various address format in WCF are
6) Explain how many types of contract does WCF defines?
WCF defines four types of Contracts
Question 44: What is WCF Messaging Layer?
Answer: Messaging layer is composed of channels. A channel is a component that processes a message in some way. Channels are the core abstraction for sending messages to and receiving messages from an Endpoint.
Message Structure
WCF uses messages to pass data or exchange information from one point to another. All messages are SOAP messages. The basic structures of a SOAP message are made up of three components.
SOAP Envelope
The SOAP envelope is a container for the two most important pieces of a SOAP message, the SOAP header and the SOAP body. A SOAP envelope contains several pieces of key information in the form of elements.
SOAP Header
Using a SOAP header, we can pass useful information about the services to the outer world if needed; its just for information sharing. Any child elements of the header element are called “header blocks”. This provides a mechanism for grouping logical data together.
SOAP Body
This element contains the actual SOAP message for communication with the SOAP receiver; a message can contain zero or more bodies. Any information intended to be exchanged when the message reaches the intended destination goes in the message body.
For more details visit the following link:
Explain the Data Contract?
Ans: The data contract is the official deal between a client and a service that abstractly explains the data to be interchanged. The data contract may be implicit or explicit. Simple data types like string, int have the implicit data type. User-defined objects are a complex or explicit type for which we have to specify the data contract through [DataMember] and [DataContract] attributes.
We can define the data contract in the following way:
Question 46: What is Duplex in WCF? Explain also Message Exchange Pattern?
Answer:
Duplex
Duplex is a Two-Way Communication Process. In which, a consumer send a message to the service and the service sends a notification that the request processing has been done. It is just like that we send some command about the printing of some papers to the Printer machine. The printer machine start communication by making the connection with our machine, and start printing the paper.
Message Exchange Patterns in WCF
The Message Exchange Pattern (MEP) provides a way of communication between client and server. MEP is a beauty of WCF. A services do some task depend on us or send a response to our request. The communication between client and server are done in form of messages. When we send a message as request and get a message as response from the service. The WCF Services support three types of Message Exchange Pattern:
Why we need the Message Exchange Pattern:
For more details visit the following link: