WCF Interview Questions and Answers Most Imported are Provided for Both Freshers and Experienced from the Real-Time Experts.
1. What’s WCF?
Answer: WCF stands for Windows Communication Foundation. it’s a framework that is employed for building, configuring, and deploying practical distributed services. Using WCF, you’ll be able to send information as asynchronous messages from one service termination to a different one. A service termination is a part of a ceaselessly out there service hosted by IIS, or it is a service hosted in an associate degree application. associate degree termination is a shopper of a service that requests information from a service termination. It provides a facility to write down safer, versatile services with no code modification. It additionally provides inherent support for work. It facilitates you to enable/disable work mistreatment configuration.
2. What are the essential parts employed in WCF?
A list of essential parts employed in WCF:
The service runtime layer contains the behaviors that occur solely throughout the particular operation of the service, that is, the runtime behaviors of the service. asphyxiation controls what number of messages are processed, which may be varied if the demand for the service grows to a planned limit.
WCF Service may be a program that exposes a set of endpoints. every termination may be a portal for communication with the globe. All the WCF communications are taken place through the termination. associate degree termination consists of 3 parts.
3. what’s the “Address” property of termination in WCF?
Answer: The “Address” property is that the part of termination outlined at the commission level. This property is employed to specify the situation wherever the service is found.
4. what’s SOA?
Answer: SOA stands for Service destined design. it’s associate degree subject area style pattern that states that each element of a system ought to be a service (here service means that a unit of a program that serves a business process), and also the system ought to be composed of many loosely coupled services means that services ought to be freelance of every different, so ever-changing one amongst them mustn’t affect the other services.
5. what’s the “Binding” property of termination in WCF?
Answer: The “Binding” property is that the part of termination outlined at the commission level. This property is employed to specify the kind of protocols, encodings, and transport. (WCF interview questions)
These all factors are set by each communication party.
6. what’s the “Contract” property of termination in WCF?
Answer: The “Contract” property is simply an associate degree interface between the shopper and server wherever shopper and server communicate with one another. Contracts are accustomed to specific operations out there.
7. What are default Endpoints?
Answer: WCF offers some default endpoints to the service if a service host doesn’t outline any endpoints however has a minimum of one base address. as an example, WCF uses the fundamental binding for the protocol address.
8. What are customary Endpoints?
Answer: WCF provides a collection of pre-defined endpoints called customary Endpoints for data exchange, discovery, and the internet. you’ll be able to assemble the quality endpoints by employing a config file and programmatically. (WCF Online Training)
Here is that the list of normal endpoints:
- MEX endpoint
- announcement endpoints
9.what’s the service?
Answer: A service may be a set of practicality exposed to the globe. Service orientation (SO) is an associate degree abstract set of principles and best practices for building service-oriented applications.
10. what’s service proxy in WCF?
Answer: WCF Proxies are accustomed communicate between shopper and server. Communication takes place by exchanging the messages within the type of requests and responses. it’ll have a small print like Service Path, Protocol details so on. (WCF interview questions)
11. what’s “Service Contracts” in WCF?
Answer: The Service Contracts attribute is employed at the service level for WCF service. It provides the list of operations that will be performed from that service.
12. What are the various instance modes in WCF?
A list of instance modes in WCF:
13. what’s the “Per Call” instance mode in WCF?
Answer: When an invitation has been created to service, it creates a brand new instance of service for every methodology decision and this may be disposed of once the response goes to the shopper. This whole method is understood as per decision instance mode.
14. what’s the “Per Session” instance mode in WCF?
Answer: Per session instance mode creates a logical session between service and shopper and it’ll be maintained until the top of the session. once shopper requests from service the session aiming to be|are} created and it’s dedicated to the instance for that shopper and it’ll be going to the top once the shopper session ends.
15. what’s the “Singleton” instance mode in WCF?
Answer: In “Singleton” mode all the purchasers are connected to the only instance of the service and once service is designed for “Singleton” mode, associate degree instances are going to be created once service is hosted and it’ll be disposed of once it shuts down.
16 What does one mean by the client?
Answer: The shopper of a service is that the program unit intense its practicality. A shopper is something sort of a Console application, Windows kind, WPF or Silverlight category or ASP.Net page, etc.
17. however, do WCF works?
Answer: WCF follows the model “Software as a Service”. during this model all units of practicality are outlined as services and for communication, every purpose may be a portal or association either with the shopper or different services. it’s a program that exposes a set of endpoints.
18. what’s the distinction between ASMX internet services and WCF?
Answer: The main distinction between WCF and ASMX internet service is that ASMX is meant to send and receive messages victimization SOAP over protocol solely whereas WCF facilitates you to send and receive messages victimization any format over any transport protocol.
ASMX internet services are hosted solely in IIS whereas the WCF service has all the subsequent hosting options:
WAS (Windows method Activation Services)
Windows NGO Services
WCF provided Host
ASMX internet services support is proscribed to protocol whereas WCF supports the protocol, TCP, MSMQ, NamedPipes.
ASMX Security is proscribed. ordinarily, authentication and authorization ar did victimization IIS and ASP.NET security configuration and transport layer security. For message layer security, WSE is used.
WCF provides the same security programming model for any protocol and it supports several identical capabilities as IIS and WS-* security protocols, to boot, it provides support for claims-based authorization that gives finer-grained management over resources than role-based security. WCF security is consistent despite the host that’s wont to implement WCF service.
Another major distinction is that ASMX internet services use XmlSerializer for publishing whereas WCF uses DataContractSerializer that is way higher in performance than XmlSerializer.
19. what percentage kinds of contract WCF defines?
There are four kinds of contracts that WCF define:
The ServiceContract attribute maps a CLR interface (or inferred interface, as you may see later on) to a technology-neutral contract. The ServiceContract attribute exposes a CLR interface (or a class) as a WCF contract, severally of that type’s visibility.
The descriptions in the information of the info sort that a service uses. this allows others to interoperate with the service. the info sorts are utilized in any part of a message, for instance, as parameters or come back sorts. If the service is victimization solely easy sorts, there’s no got to use information contracts expressly.
Can be related to a service operation to denote errors that may be coming to the caller.
Describes the format of a message. for instance, it declares whether or not message parts ought to enter headers versus the body, what level of security ought to be applied to what parts of the message, and so on.
20. What are the necessities for hosting a WCF service?
Answer: You need a minimum of a managed method, a ServiceHost instance associated and termination organized for hosting a WCF service.
Following are the attainable approaches for hosting a service:
Hosting during a Managed Application/ Self Hosting:
Hosting on internet Server
IIS 6.0 (ASP.NET Application supports solely HTTP)
Windows method Activation Service (WAS) i.e. IIS 7.0 supports the protocol, TCP, named pipes, MSMQ.
21. What are the various isolation levels in WCF?
The following could be a list of various isolation levels in WCF:
Read Uncommitted: additionally referred to as dirty isolation level. It makes certain that corrupt information can not be browsed. this can be a rock bottom isolation level.
Read Committed: It ensures to not browse the info that has been modified by the other application and isn’t nonetheless committed. it’s the default level.
Repeatable Read: It stops the usage of dirt browse and non-repeatable browse. It states that information fetched through a question is going to be fast and can not be updated by the other group activities.
Serializable: It doesn’t permit any modification and addition of recent information until the group action is completed. this can be thought about to be an awfully restrictive level.
Snapshot: It raises a slip-up on modifying information that has already been modified by any group action.
22. What are default Endpoints?
Answer: WCF offers some default endpoints to the service if a service host doesn’t outline any endpoints however has a minimum of one base address. for instance, WCF uses the essential binding for the protocol address.
23. What are commonplace Endpoints?
Answer: WCF provides a collection of pre-defined endpoints referred to as commonplace Endpoints for information exchange, discovery, and the internet. you’ll set up the quality endpoints by employing a config file and programmatically.
Here is that the list of ordinary endpoints:
- MEX endpoint
- announcement endpoints
24. What are the various WCF contracts?
Answer: WCF contract specifies the service and its operations. WCF has 5 kinds of contracts:
- Service contract
- Operation contract
- Data contract
- Message contract
- Fault contract.
25. what’s the complete type of WCF?
Answer: the complete type of WCF is that the Windows Communication Framework.
26. what’s the first operate of WCF?
Answer: to form the communication between numerous processes during a given system easier is that the main operate of WCF.
27. What are a number of the opposite functions WCF is well?
Answer: WCF is additionally used for different functions like queuing, services, MS electronic communication, and remoting.
28. With WCF will one communicate with different non-Microsoft applications also?
Answer: affirmative, one will communicate with different non-Microsoft applications like J2EE yet.
29. What are the varied ways in which of hosting a WCF service?
There are four ways in which of hosting a WCF service.
Windows services hosting
Windows Activation Services hosting (WAS)
30. What is Binding?
Answer: WCF binding specifies however the service and consumer can communicate with one another in terms of transport protocols and encryption (such as text or binary). WCF binding could be a set of binding parts and with every component specify, however, the service and consumer can communicate with one another. every binding should have a minimum of one transport component and one message encryption component. (WCF interview questions)
31. What is Concurrency Management in WCF?
Answer: Concurrency management is closely associated with Instance management in WCF however each ar 2 various things. Instance management specifies, however, the service instances are created whereas Concurrency management specifies what number of synchronic requests are handled by the service instances. By victimization concurrency, you’ll be able to create your service instance thread-safe. By default, a per-call service instance is thread-safe since every request is served by a brand new service instance. A per-session service instance isn’t thread-safe since multiple requests of a consumer are served by one service instance. Hence, it’s needed concurrency management. one service instance isn’t thread-safe since multiple requests of all purchasers are served by one service instance. Hence, it’s needed concurrency management.
32. What is Impersonation?
Answer: Impersonation may be thanks to authorizing a caller (client) identity to access the service domain’s resources. The service resources could also be native files or info tables and will get on the identical machine on that the service is hosted. By default, impersonation is disabled, and resources are accessed by the victimization of the WCF service’s method identity.
33. What is service versioning?
Answer: After the initial reading of the WCF service, you’ll have to be compelled to modification the service for a range of reasons like ever-changing business wants or fixing other problems. every modification in your existing service introduces a brand new version of the service. Service versioning is useful in backward compatibility together with your existing purchasers.
34. What is WCF information Service?
Answer: WCF information Services uses OData (Open information Protocol) protocol for querying or manipulating the info. WCF information Services are constructed on high of WCF REST Services. it’s a reposeful service to support CRUD operations on the info victimization the hypertext transfer protocol. It supports all info operations victimization URI. information protocol will expose information from the electronic information service, File systems, Web sites, services, etc. It supports XML or JSON format for exposing the info.
35. justify the WCF RIA?
Answer: WCF RIA is that the framework for developing the n-tier application for RIA (Rich net App). it’s utilized in made net Apps like Silverlight, AJAX, etc. WCF RIA is employed to unravel major issues like Tight Coupling.
36. however, would you generate a proxy for WCF?
You can generate a proxy by victimization the subsequent steps:
Using Visual Studio
37. what’s binding?
Answer: Binding is employed to outline however associate degree end communicates to the planet. It defines transport as hypertext transfer protocol or transmission control protocol. It will contain binding components that specify details just like the security mechanisms accustomed to secure message patterns employed by associate degree end.
38. What are the various modes of communication in WCF?
There are 3 modes of communication in WCF:
In the unidirectional operation mode, the consumer can send an asking to the server and doesn’t care whether or not it’s a hit or failure of service execution. there’s no come from the server-side, it’s unidirectional communication.
When a consumer requests the WCF service and consumer can wait to urge a response from the service (till receiving timeout). when obtaining the response it’ll begin capital punishment the remainder of the statement.
It is the service to a decision the consumer. In which, service can act as consumer and consumer can act as service.
39. what’s the request-reply mode in WCF?
Answer: When a consumer requested service, it’ll wait till it gets the response back.
If the response isn’t received till the given time, it’ll show a mistake. (WCF interview questions)
If the consumer gets the response then following directions are dead.
40. what number of styles of binding are there in WCF?
WCF supports 9 styles of bindings:
- Basic binding
- TCP binding
- Peer network binding
- IPC binding
- Web Services binding
- Federated internet Service binding
- Duplex WS binding
- MSMQ binding
- MSMQ integration binding
41. What does one mean by contract in WCF?
A contract is that the service compatibility, and therefore the customers’ want is certain up with the service mechanism.
42. What square measures the parts of the WCF application?
WCF application consists of three components:
WCF Service Host
WCF service shopper
43. What square measures the isolation levels provided in WCF?
Isolation levels provided in WCF square measure given below:
- Read Uncommitted.
- Read Committed.
- Repeated browse.
44. what’s the assorted address format of WCF?
Address format of WCF square measure given below:
- HTTP format
- TCP format
- MSMQ format
45. What does one mean by information Contract Serializer?
Answer: These are the commonly asked WCF Interview queries in AN interview. once the thing instance changes into a conveyable and visual format, that method is thought a serialization, and information serialization is additionally referred to as Datacontractserilizer.
46. Describe the binding in WCF?
The binding in WCF square measure listed below:
- Basic HTTP Binding
- NetTcp Binding
- WSHttp Binding
- NetMsmq Binding
47. what’s the namespace name used for the WCF service?
ServiceModel service is employed for WCF service.
48. What square measures the MEPs of WCF?
The MEPs of WCF square measure given below:
- Request and Response
49. What quite dealing manager is supported by WCF?
They are as follows:
- WS- Atomic dealing
50.. What square measures the various information contracts in WCF?
Different information contacts in WCF square measure given below:
- Data Contact
- Data Member
51.What square measures the various instance modes of WCF?
Different instance modes of WCF square measure given below:
52. What square measures the various ways in which of Hosting Webservices?
The WCF service may be hosted within the following ways:
WAS (Windows Activation Service)
53. What square measures the various transport schemas supported by WCF?
The transported schemas square measure given below:
- HTTP >TCP > Peer network> IPC> MSMQ
54. what’s used for questioning or operative the info by WFC information services?
Answer: OData Protocol is employed. information service is formed at the height of the WFC Rest service. The quiet service handles CRUD operations by the employment of hypertext transfer protocol. By the employment of URI, it helps all the information. information protocol uncovers information from the filing system, services websites, and online database. And additionally maintains the format of XML or JSON to point out the info.
55. What’s required for backward compatibility?
Answer: Service versioning is employed for backward compatibility for these customers. For the modification of the service for the unsure wants of the occupation or to resolve a difficulty once the first preparation of the WCF service. (WCF interview questions)
56. Describe Concurrency Management? And its types?
Answer: it’s wont to handle multiple threads and to command by the System.ServiceModle.ServiceBehaviourAttribute. It identifies the number of coincidental requests is hold by service instances and form thread-safe. sorts square measure Single, Multiple, re-entrant concurrency Mode.
57. outline Instance Management?
Answer: a gaggle of messages on the consumer request for immediate service is taken into account as Instant management. it’s wont to support the incoming service request and also the management of services. There square measure 3 ways for immediate management?
- Per call
- Per Session
58. outline Endpoints?
Answer: By the employment of endpoint WCF offers the services to the shoppers. Endpoints offer the vital suggests that and also the steering to the client for interacting with completely different services.
59. Tell the assorted transport of Duplex contracts? outline
Answer: Duplex electronic messaging is for interacting with the client by decision back method. numerous transport like hypertext transfer protocol, TCP, named pipes. A client and servers will severally act with one another by a method and Request-Reply contract.
60. outline Binding in WFC?
Answer: Binding tells the North American nations concerning the style within which the service and also the client can act with each other by binary or text A binding ought to have a transport component ad a message committal to writing component.
61. What does one mean by WCF?
WCF (Windows Communication Foundation) could be a framework that’s wont to build service-oriented applications.
62. justify the basics of WCF?
The fundamentals of WCF square measure given below:
Unification – (COM+ Services, net Services, .NET Remoting, Microsoft Message Queuing)
63. what’s the requirement for WCF?
These square measure the fundamental WCF Interview queries asked in associate degree interviews. we’d like WCF as a result of completely different protocols that can support the service created by exploitation WCF.
64. What square measures the options of WCF?
Service Orientation, ability, Service information, information Contracts, Security, Transactions, mythical being and REST Support, Extensibility.
65. Describe the benefits of WCF.
Service-Oriented, location freelance, Language-Independent, Platform freelance, Support Multiple Operations, It supports every kind of protocol.