Q & A - WCF Questions & Answers

 

Q&A 1.

What is WCF ?

Microsoft has introduced WCF for inter process communication. WCF let us to establish communication channels using MSMQ, Remoting etc.

Before the WCF, the Asp.Net Web Services was used to create services but that type of service is only accessible to Windows client hosted on HTTP protocol.

Q&A 2.

Explian what is REST model?

Representational State Transfer model in web Api means Request and response of data and object in network over http based protocol is stateless.

Because REST is stateless, the client context is not stored on the server between requests, giving REST services the ability to be retried independently of one another.

If the web server stores data in a backend manner and uses it to identify the user as an always-connected client, the service is Stateful.

Q&A 3.

Whats are uses of Rest based Web API?

REST stands for Representational State Transfer, which is an architectural style for networked hypermedia applications.

  • It is primarily used to build Web Services that are lightweight, maintainable, and scalable, and support limited bandwidth.
  • It is used to create simple HTTP Web Service. It supports XML, JSON, and other data formats.
  • It is used to access service data in web applications as well as many mobile apps and other external devices.

Q&A 4.

How to consume WCF web services using proxy?

There are two ways to communicate with client application in Windows Communication Foundation. First one is using the ChannedFactory and other one is creating proxies classes.

The WCF Service (SVC) can be called (consumed) without using Proxy by making use of the ChannelFactory class in ASP.Net.

The proxy is used by the client application to interact with the service.
To create a proxy, run Visual Studio 2008 command prompt. Using service utility, we can create the proxy class and its configuration information.

How to create a wcf client using SVCUTIL.exe

svcutil.exe http://localhost/IISHostedService/Service.svc

Q&A 5.

Explain the components used in WCF?

Below are the essential components of WCF –

  1.     Service class
  2.     End point
  3.     Hosting Environment

 

 

Q&A 6.

What is Endpoint in WCF?

All communication with a Windows Communication Foundation (WCF) service occurs through the endpoints of the service. Endpoints provide clients access to the functionality offered by a WCF service.

Endpoint will have following four properties –

  • Address - An address that indicates where the endpoint can be found.
  • Binding - A binding that specifies how a client can communicate with the endpoint.
  • Contract - A contract that identifies the operations available.
  • Behaviors - A set of behaviors that specify local implementation details of the endpoint.

Q&A 7.

Explain Service Behavior in WCF?

The Service Behavior attribute is used to apply behavior at the service level. It allows you to control things such as:

  • Concurrency
  • Throttling
  • Transaction
  • Session Management
  • Thread Behavior

Session management and the Concurrency are really important and are the most useful properties in Service Behavior.

Q&A 8.

Explain "Address" property of endpoint in WCF?

"Address" property is the part of endpoint defined in service level and this property is used to determine the location of the service, where it is located. It is represented in the WCF object model by the EndpointAddress class. An EndpointAddress class contains:

  • A Uri property, which represents the address of the service.
  • An Identity property, which represents the security identity of the service and a collection of optional message headers.

Q&A 9.

Explain "Binding" property of endpoint in WCF?

"Binding" property is the part of endpoint defined in service level and this property is used to decide out the type protocols, encoding's and transport. These all factors has been decided by both the parties who want to communicate each other. The transport protocol to use (for example, TCP or HTTP).

 

Q&A 10.

What is Throttling in WCF?

"Throttling" is used to limit the sessions or instances to be created at application level. And this will increase the performance.


Related Quiz Content

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