WCF (Windows Communication Foundation) MCQs

WCF (Windows Communication Foundation) MCQs

Our team has conducted extensive research to compile a set of WCF (Windows Communication Foundation) MCQs. We encourage you to test your WCF (Windows Communication Foundation) knowledge by answering these 40 multiple-choice questions provided below.
Simply scroll down to begin!

1: For which of the following options it is an advantage that data is transmitted in a text format rather than a binary format?

A.   SOAP

B.   WSDL

C.   XML 

2: Following are the disarranged steps for the programming life cycle of Windows Communication Foundation (WCF).
1. Build the client application.
2. Define the Service Contract.
3. Host the service in an application.
4. Configure the Service by specifying endpoint information and other behavior information.
5. Implement the Service Contract.
Which of the given answer options is the correct arrangement of the steps?

A.   1, 2, 4, 3, 5

B.   1, 2, 5, 4, 3

C.   2, 5, 4, 3, 1

D.   2, 3, 4, 1, 5 

3: What is the use of the "Finalize" method of "SoapProcessingBehavior" class in WCF 4?

A.   It is used to restrict the addition of binding elements to an endpoint.

B.   It allows the objects to release/free resources before they are reclaimed by garbage collection.

C.   It restricts the creation of a shallow copy of the current instance/object.

4: Which of the following pieces of information is provided by the WCF service contract in the .Net Framework 4.0?

A.   The grouping of operations in a service.

B.   The location of the operations.

C.   The specific protocols and serialization formats that are used to support successful communication with the service.

D.   All of the above.

5: Which of the following situations can cause a proxy/channel error?

A.   A contract mismatch existing between the client and the service.

B.   Client using an incorrect address.

C.   The service host not listening for incoming messages.

D.   Unavailability of a network 

6: Which of the following namespaces contains classes through which we can send and receive messages from workflows?

A.   System.ServiceModel.Channels

B.   System.ServiceModel.ComIntegration

C.   System.ServiceModel.Activation

D.   System.ServiceModel.Activities

7: In WCF 4, the service contracts are like ________ and the operation contracts are like __________.

A.   Interfaces, Methods

B.   Classes, Interfaces

C.   Classes, Methods

D.   Methods, Interfaces

E.   Interfaces, Classes 

8: Which of the following pre-defined bindings is incorrect with regards WCF 4?

A.   MsmqIntegrationBinding

B.   WSFederationHttpBinding

C.   NetPeerTcpBinding

D.   NetDualMsmqBinding 

9: From the following options, select the interface that is used to clear the Windows token cache on demand.

A.   ISecurityContextSecurityTokenCache

B.   IIssuanceSecurityTokenAuthenticator

C.   RenewedSecuriTyTokenHandler

D.   ILogonTokenCacheManager 

10: Which of the following are not the members of "X509KeyIdentifierClauseType" enumeration?

A.   IssuerSerial

B.   MatchesKeyIdentifierClause

C.   SubjectKeyIdentifier

D.   ResolveKeyIdentifierClause

E.   RawDataKeyIdentifier 

11: Which of the following properties of the endpoints of the WCF service helps to identify the operations available?

A.   Contract

B.   Binding

C.   Set of behaviors

D.   Address

12: Which of the following encoding mechanisms is not used by WCF 4?

A.   XML 1.0

B.   MTOM

C.   Binary

D.   DIME 

13: Which of the following forms of serialized XML is supported by the DataContractSerializer?

A.   Encoded

B.   Literal

C.   Decoded

D.   Remote 

14: Which of the following error handling methods is not used by WCF to handle application errors?

A.   Using fault contracts

B.   Implementing the IErrorHandler interface

C.   Directly handling the exception thrown

D.   Handling ServiceHost events

15: The internal threading model that provides support for multi-threaded services is controlled by ____?

A.   ConcurrencyMode

B.   ServiceDiscovery Mode

C.   InstanceContextMode

D.   ClietCredential Mode 

16: A generic Windows Communication Foundation (WCF) routing implementation that can be used within your applications is provided by the _________ Class in WCF 4.

A.   RoutingBehavior

B.   RoutingConfiguration

C.   RoutingExtension

D.   RoutingService

17: How many columns can you select by the $orderby OData system query option in the .Net Framework 4.0?

A.   5

B.   12

C.   20

D.   Infinite

18: Which of the following is false about WCF?

A.   WCF supports self-hosting.

B.   The namespace used for serialization in WCF 4 is "System.RunTime.Serialization".

C.   In order to work with WCF it is not compulsory to run IIS.

D.   WCF returns unhandled exceptions to the client as Simple Object Access Protocol(SOAP) faults.

19: Which of the following endpoints in Windows Communication Foundation 4 describes a standard endpoint that is configured to use Windows Communication Foundation discovery in the application of a Windows Communication Foundation client?

A.   discoveryEndpoint

B.   dynamicEndpoint

C.   mexEndpoint

D.   udpDiscoveryEndpoint 

20: In which type of authentication does the service host check and validate the caller certificate information for service authentication that was sent by the client to the service communication?

A.   Windows authentication

B.   No authentication

C.   X509 certificates 

21: Each WCF endpoint contains:
1.address
2.binding
3.contract

A.   1 and 3 only

B.   2 and 3 only

C.   1 and 3 only

D.   1, 2 and 3

22: Which of the following about WCF is false?

A.   WCF uses DataContractSerializer Class by default for serialization.

B.   DataContractSerializer Class serializes the public members only.

C.   DataContractSerializer Class also serializes the members in which there is i-dictionary implementation. 

23: What is the function of the WCF Data contracts in the .Net Framework 4.0?

A.   They define, for each parameter or return type, what data is serialized to be exchanged.

B.   They define which operations the client can perform on the service.

C.   They define which errors are raised by the service, and how the service handles and propagates errors to its clients

24: Which of the following is/are the way(s) of hosting the WCF service?

A.   Windows service

B.   IIS hosting

C.   Windows Activation service

D.   Self-hosting

E.   All of the above 

25: Which of the following is an incorrect statement regarding Windows Communication Foundation (WCF) 4.

A.   The applications built in Windows Communication Foundation (WCF) 4 can interoperate directly with other applications that are built in ASMX.

B.   The applications built in Windows Communication Foundation (WCF) 4 can interoperate directly with non-WCF-based applications.

C.   Windows Communication Foundation (WCF) 4 supports SOAP but not REST 

26: Which of the following statements is correct about the WSHttpBinding of WCF in the .Net framework 4.0?

A.   It is a secure and inter-operable binding that is suitable for non-duplex service contracts.

B.   It is a secure and inter-operable binding that is suitable for duplex service contracts or communication through SOAP intermediaries.

C.   It is a secure and optimized binding that is suitable for cross-machine communication between WCF applications.

D.   It is a queued binding that is suitable for cross-machine communication between WCF applications.

27: From the following options, select the correct endpoint that is used to expose Ajax services?

A.   mexEndpoint

B.   webHttpEndpoint

C.   dynamicEndpoint

D.   webScriptEndpoint 

28: Which of the following bindings in WCF 4 is used to connect to other WCF endpoints on the same machine/computer?

A.   WSHttpBinding

B.   NetMsmqBinding

C.   NetNamedPipeBinding

D.   NetTcpBinding 

29: Which of the following is the default binding used in WCF 4?

A.   BasicHttpBinding

B.   WSHttpBinding

C.   NetTcpBinding

D.   WSDualHttpBinding 

30: Which of the following OData system query options is used to determine the maximum number of records to be returned in the .Net Framework 4.0?

A.   $top

B.   $filter

C.   $select

D.   $expand 

31: In WCF 4, which of the following file(s) is/are used to define contract(s)?
1. IService.cs
2. Service.cs

A.   1 only

B.   2 only

C.   Both 1 and 2 

32: State True/False.
Can you host a Windows Communication Foundation 4 service on two different protocols on a single server?

A.   Yes

B.   No 

33: State True/False.
In WCF 4, the DataContractSerializer translates the hash table into XML format.

A.   True

B.   False 

34: Which of the following options is not an isolation level provided in WCF 4?

A.   READ UNCOMMITTED

B.   READ COMMITTED

C.   SNAPSHOT

D.   REPEATABLE READ

E.   SERIALIZABLE

35: State True/False.
The WCF service can send and receive a message only through the Simple Object Access Protocol (SOAP).

A.   True

B.   False 

36: Which of the following bindings support message streaming in WCF 4?

A.   BasicHttpBinding

B.   WSHttpBinding

C.   WSDualHttpBinding

D.   NetNamedPipeBinding

E.   NetTcpBinding

F.   WSFederationHttpBinding 

37: Which of the following statements is false about WCF sessions?

A.   The calling application explicitly initiates and terminates the sessions.

B.   A group of messages is correlated into a conversation by the sessions.

C.   Processing of the messages delivered during a session is done in the order in which they are received.

D.   There is a general data store associated with a WCF session.

38: What is meant by a proxy for WCF service?

A.   It is a class through which a service client and the service can interact.

B.   It is a method exposed by a service during a call.

C.   It is a service that is used to combine WCF and WPF

39: Suppose your WCF service root URL is "http://examples.svc". What will be the response when you request a WCF data service URL with a $skip system query option, as shown below, in the .Net Framework 4.0?
http://examples.svc/Products?$skip=2&$top=2&$orderby=Rating

A.   The response will be the first two product entries from the collection of all products after sorting the collection in descending order of Rating.

B.   The response will be the third and fourth product entries from the collection of all products after sorting the collection in ascending order of Rating.

C.   The response will be the second and third product entries from the collection of all products after sorting the collection in descending order of Rating.

40: Extension of a WCF 4 service is _______.

A.   .asmx

B.   .cs

C.   .svc

D.   .aspx 

41: Which of the following operating systems supports the Message Queuing functionality of WCF?

A.   Windows 98

B.   Windows Vista

C.   Windows 7

D.   All of the above

42: Which of the following is/are the address format(s) in WCF (Windows Communication Foundation) 4.0?
1. http://localhost:
2. net.msmq://localhost:
3. net.tcp://localhost:

A.   1 and 2 only

B.   2 and 3 only

C.   1 and 3 only

D.   All of the three

E.   None of the three

43: In WCF, what is the significance of the ReceiveRetryCount property of a Poison message in the .Net Framework 4.0?

A.   It is an integer value that indicates the maximum number of times to retry delivery of a message from the application queue to the application.

B.   It is an integer value that indicates the maximum number of retry cycles.

C.   It is the time delay between retry cycles 

44: Which type of file must be provided while hosting a Windows Communication Foundation (WCF) service under the Internet Information Services (IIS) or the Windows Process Activation Service (WAS)?

A.   .asp file

B.   .axd file

C.   .svc file

D.   .net file