Q & A - WCF Questions & Answers

 

Q&A 1.

Explain "Contract" property of endpoint in WCF?

Contracts are an interface between client and server, contracts are used to identify operations available.

The contract outlines what functionality the endpoint exposes to the client. 

  1. What operations can be called by a client.
  2. The form of the message.
  3. The type of input parameters or data required to call the operation.
  4. What type of processing or response message the client can expect.

Q&A 2.

Explain the types of contracts available in WCF?

Below are given the types of contracts available in WCF

  1. Data Contracts
  2. Service Contracts
  3. Message Contracts
  4. Fault Contracts

Q&A 3.

Mention the list of bindings schemas supported by WCF?

Below are the list of schemas supported by WCF:

  • TCP
  • HTTP
  • MSMQ
  • IPC
  • Peer Network

Q&A 4.

What are different types of WCF bindings?

Different types of WCF bindings and schema supported:

  • BasicHttpBinding (Http, Https)
  • WSHttpBinding (Http, Https)
  • WSDualHttpBinding (Http, Https) 
  • NetTcpBinding (TCP)
  • WSFederationHttpBinding (Http, Https)
  • NetMsmqBinding (MSMQ)
  • NetNamedPipeBinding (IPC)
  • NetPeerTcpBinding (Peer Network)
  • MsmqIntegrationBinding (MSMQ)

Q&A 5.

List instance modes available in WCF and explain them.

Below are the list of instance modes in WCF available.

  1. Per Call - In "Per Call" mode, When a request is made to the service, every client gets a new service instance and will be disposed once the response is delivered to the client.
  2. Singleton - When we configure a service as a singleton, all clients are connected to a single instance context. We configure a singleton service by setting the InstanceContextMode property as single. instance will be created when service is hosted and it will be disposed once it is reset.
  3. Per Session - Per Session creates a logical session between service and client and it will be maintained till the session the ends. When client requests from service the session will be created and it is dedicated to the instance of the client and it will end when client session gets an end.

Q&A 6.

What is Service Proxy in WCF?

WCF Proxies are used to enable the communication between client and server by exchanging the messages in the form of requests and responses. It will have the details like Service Path, Protocol details and so on.

Q&A 7.

Explain Service Oriented Architecture?

SOA is way to develop service oriented applications and WCF technology helps to build SOA applications.

WCF is a technology which makes building services easier, and it works on all transports not only HTTP so it is more generic than Web Services which works only on Http.

SOA is a set of services not necessarily Web Services that are built independently to support a range of client applications. 
 

SOA principles are:

  • Services are autonomous
  • Service loose coupling
  • Services share schema and contract, not classes
  • Discoverability of services
  • Metadata exposure
  • Service abstraction
  • Service reusability

 

Q&A 8.

What do you understand by term SOAP?

SOAP represents the Simple Object Access Protocol, which is utilized for the trading information in XML-based organization over HTTP. A SOAP message has a discretionary header and a required body component. A SOAP message header can contain the application-explicit data like confirmation or approval and so forth. Additionally, a SOAP message header must be the main component of the SOAP Envelope component. The SOAP body is composed of the real SOAP message.

Q&A 9.

What are DataContarcts in WCF?

In WCF while communicating bwtween server and client through message. We decorate class with [DataContact] attribute to serialize the class & by using [DataMember] attribute over its properties. For security purpose we are serializing the messages sent across the wire.

 

Q&A 10.

Mention types of transaction managers in WCF?

Here are the list of transaction managers in WCF.

  1. WS- Atomic Transaction
  2. Light Weight
  3. OLE Transaction

Related Quiz Content

x
This website is using cookies to make user experience of the site better. More info. OK