Advanced Interview Questions On Wcf

21) Mention what are the various address format in WCF?

The various address format in WCF are

  • HTTP Address Format: à http:// local host:
  • TCP Address Format:à net.tcp://local host:
  • MSMQ Address Format:ànet.msmq://localhost:
  • 6) Explain how many types of contract does WCF defines?

    WCF defines four types of Contracts

  • Service Contracts
  • Data Contracts
  • Fault Contracts
  • Message 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:

  • It explains the explicit format of the data transmitted to and from the service operations.
  • It explains the structure and kinds of the data interchanged in the service messages.
  • Data Contract maps the CLR types to the XML schema.
  • It specifies how the data types are deserialized and serialized. Using Serialization, we can transform the object into a sequence of bytes that we can transmit over the network. Using deserialization, we can match the object from the series of bytes that we receive from the invoking application.
  • The versioning system enables us to handle the modifications to the structured data.
  • Question 46: What is Duplex in WCF? Explain also Message Exchange Pattern?



    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.

  • Duplex service allows calling back some operation (function) on the client.
  • Duplex service also knows as Call Backs.
  • All Binding does not support duplex service.
  • Duplex communication is not standard. They are absolute Microsoft feature.
  • wsDualHttpBinding supports duplex communication over HTTP binding.
  • Duplex communication is possible over netTcpBinding and netNamedPipeBinding
  • 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:

  • When we want the calling of the function to not take more time.
  • We just want to call the function and not want wait for the response.
  • When we want that function call is not blocking and at the same time we want something out of the function (response) for our application.
  • When we want a two-way communication mechanism.
  • For more details visit the following link:

    WCF Interview question :- Can we do method overloading in WCF services ?

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *