Olete.in
Articles
Mock Tests
🧪 WCF MCQ Quiz Hub
WCF Mcq Question Set 1
Choose a topic to test your knowledge and improve your WCF skills
1. Which of the following is NOT true?
A WCF Service can be consumed by Windows applications
A WCF Service can be consumed by Web applications
A WCF Service can perform calculations
A WCF Service cannot return a dataset
2. WCF services can communicate with _______.
all programming languages
XML
only the languages included with Visual Studio .NET
multiple platforms and multiple languages
3. The standard method for storing data that can be transferred easily from one machine or platform to another is ___
XML
SOAP
WSDL
WCF
4. One of the advantages of using _______ is that data are transmitted in a text format rather than a binary format.
XML
SOAP
WSDL
WCF
5. Data that is in _______ format can pass through many firewalls that _______ cannot penetrate.
binary, text
text, binary
SOAP, WCF
WCF, SOAP
6. ___ is a popular standard that includes a set of rules for handling requests and responses including class names, method names, and parameters.
XML
WCF
WSDL
SOAP
7. The information about the names of the methods, the parameters that can be passed, and the values that are returned from the functions is controlled in some Web services by a description specified in _______.
XML
SOAP
WSDL
WCF
8. Always end your URI (or URL) with a ________ to avoid an extra trip to the server to determine that it is a site rather than a directory.
hyphen
slash
backslash
double slash
9. A resource on the Web is uniquely identified by its URI, which means _____
Uniform Resource Identifier
Universal Registered Identifier
Uniform Registered Identifier
Universal Resource Identifier
10. To add a WCF Service, select the solution name in the Solution Explorer and select _______ from File menu.
Add / New Solution
Add / New Web Site
Add / New Service
Add / New Library
11. You have created a new service based on Windows Communication Foundation and also a client application to test the service. You want add an endpoint in the web.config file of the client application to use the new service. Which values should you include in you service element of the web.config file?
Address
Contract
Binding
All of these
12. A service contract specifies what an endpoint communicates to the outside world. At a more concrete level, it is a statement about a set of specific messages organized into basic message exchange patterns (MEPs), such as request/reply, one-way, and duplex. Which of the following is NOT part of the Service Contract specification:
The data types of messages
The specific protocols and serialization formats
The location of the operations
The frequency of messages per second
13. Services are groups of operations. To create a service contract you usually model operations and specify their grouping. In Windows Communication Foundation (WCF) applications, developers define the operations by creating a method and marking it with the which attribute?
ServiceContractAttribute
DataMemberAttribute
DataContractAttribute
OperationContractAttribute
14. You’ve created a new class in your .NET project that contains a wide variety of operations grouped together to form part of a Server Contract. You now need to add an attribute to the class to define it as a service contract. Which attribute should you use?
OperationContractAttribute
DataMemberAttribute
DataContractAttribute
ServiceContractAttribute
15. Both classes and interfaces represent a grouping of functionality and, therefore, both can be used to define a WCF service contract. However, it is recommended that you use interfaces because they directly model service contracts. Without an implementation, interfaces do no more than define a grouping of methods with certain signatures. Which of the following is a benefit of using interfaces to define Service Contracts?
Service contract interfaces can extend any number of other service contract interfaces
You can modify the implementation of a service contract by changing the interface implementation, while the service contract remains the same
A single class can implement any number of service contracts by implementing those service contract interfaces.
All of these
16. You have created a new class which will be the basis for a Service Contract. You have used ServiceContractAttribute and OperationContractAttribute to decorate the class and the methods. Which of the following is NOT an advantage of using classes instead of interfaces for Service Contracts?
Speed
All of these are disadvantages
Simplicity
Multiple Inheritance
17. Which of the following is TRUE regarding service operations and references to objects?
Objects must be serializable
You can’t return values from service operations
Objects are passed as references
You can’t pass parameters to service operations
18. You’ve created a new class and decorated it with the DataContractAttribute so that it forms a Data Contract for WCF. This class contains several attributes that you want to make available as part of the Data Contract. Currently these attributes are declared as private. What do you need to do to ensure these attributes are serializable?
Add the DataMemberAttribute and change the type to public
Add the DataContractAttribute to the attribute
Change the type to internal
Add the DataMemberAttribute or change the type to public
19. A developer has designed a service that contains a method called TakeAction which is decorated with the following attribute: [OperationContractAttribute(IsOneWay=true)] Another client application will invoke the TakeAction operation and continue processing after WCF writes the message to the network. What must the developer of the TakeAction method do to ensure the client action can call this method?
use object as the return type
Use FaultException as the return type
Remove all parameters from the method signature
Use void as the return type
20. The signature of a service operation dictates a certain underlying message exchange pattern (MEP) that can support the data transfer and the features an operation requires. You want to adopt a pattern that supports the sending and receiving of messages by both the service and client. Which patter should you choose?
one-way
none of these
request/reply
duplex
21. Study the following line of code: OperationContext.Current.GetCallbackChannel(); The ICalendarDuplexCallback interface is defined as the CallbackContract property in the Service Contract. In which class should you use this line of code?
Client
You should never use this
Both
Service Discovery
22. A client application interacts with a new Service that calculates interest rates for the banks customers. The Service Contract contains BasicHttpBinding as the binding type in the endpoint configuration. The service contains some methods that return sensitive information such as customers names and addresses. You want to ensure that these methods are encrypted. What should you do?
Set the ProtectionLevel to None in the ServiceContractAttribute
Set the ProtectionLevel in the OperationContractAttribute to EncryptAndSign for each of the sensitive methods
Nothing, all messages will be encrypted and signed already
Set the ProtectionLevel to Sign in the ServiceContractAttribute
23. Which of the following is FALSE regarding the WSHttpBinding class?
Provides WS-Addressing
Provides un-encrypted messages by default
Provides reliable messaging
Provides transactions
24. In Windows Communication Foundation (WCF) applications, which of the following is FALSE regarding Sessions?
Messages delivered during a session are processed in the order in which they are received
They are explicitly initiated and terminated by the receiving application
There is no general data store associated with a WCF session
Sessions correlate a group of messages into a conversation
25. The instancing behaviour (set by using the System.ServiceModel.ServiceBehaviorAttribute.InstanceContextMode property) controls how the InstanceContext is created in response to incoming messages. You have created a new WCF service and set the InstanceContextMode to PerCall. What is the behaviour of the InstanceContext in this mode?
A new InstanceContext is created for each call
A new InstanceContext is created for each channel
A new InstanceContext is created for all calls
A new InstanceContext is never created
26. When configuring a WCF service using Visual Studio, you can use either a Web.config file or an App.config file to specify the settings. The choice of the configuration file name is determined by the hosting environment you choose for the service. Where does the endpoint configuration element lie in a .NET configuration file?
System.ServiceModel – bindings – endpoint
System.ServiceModel – services – service – endpoint
System.ServiceModel – endpoint
System.ServiceModel – behaviors - behavior – endpoint
27. The System.ServiceModel.Channels namespace contains the DeliveryFailure enumeration. DeliveryFailure specifies the possible types of delivery failure for a message read from the queue. Which of the following elements is a valid DeliveryFailure?
BadSignature
AccessDenied
ReceiveTimeout
All of these
28. Which class in WCF represents the unit of communication between endpoints in a distributed environment?
RequestContext
Message
Binding
ChannelBase
29. Windows Communication Formats (WCF) is Microsoft's technology for communicating between applications on the same computer system, on a network, or across the
True
False
all of the above
None of the mentioned
30. It is possible for a single application to be both a client and a service.
True
False
all of the above
None of the mentioned
31. WCF cannot communicate with other platforms that support SOAP and simple XML.
True
False
all of the above
None of the mentioned
32. An endpoint indicates where messages can be sent (address).
True
False
all of the above
None of the mentioned
33. Data that is in binary format can pass through any firewall.
True
False
all of the above
None of the mentioned
34. WSDL contains information about the names of the methods, the parameters that can be passed, and the values that are returned from the functions.
True
False
all of the above
None of the mentioned
35. For technical specifications, the industry standard term URL is preferred to URI.
True
False
all of the above
None of the mentioned
36. The transport protocol used by SOAP is HTTP.
True
False
all of the above
None of the mentioned
37. To rename a Web Service you need to change only the name in the Solution Explorer.
True
False
all of the above
None of the mentioned
38. When a new project is added to a WCF Service solution, the projects are saved independently.
True
False
all of the above
None of the mentioned
39. WCF services can communicate with _____
Visual Studio .NET
programming languages
Multiple platforms and multiple languages
XML
40. In wcf message contract can be applied to ____
type using MessageContract attribute
type using Contract attribute
type using Message attribute
none of the above
41. WCF stands for _____
Windows Common Framework
Windows Communication Foundation
Windows Common Foundation
Windows Communication Framework
42. WCF is developed by ____
Apple Inc.
Google
IBM
Microsoft Corporation
43. A service contract is ____
not applicable to interface in wcf
applicable to interface in wcf
Both A and B
none of the above
44. IIS stands for ____
Internet International Services
Internet Information Solution
Internet Information Services
Internet Indirect Services
45. Data that is in format _________ can pass through many firewalls that ________ cannot penetrate.
binary, text
text, binary
Soap wcf
none of the above
46. Which of the following statements is false about hosting?
Shared hosting is cheaper than dedicated hosting
Dedicated hosting is safer than shared hosting
Shared hosting is safer than dedicated hosting
none of the above
47. Which type of contract is applicable to interface in wcf?
Service Contract
Operation Contract
Both A and B
none of the above
48. WCF supports which transport schema?
MSMQ
HTTP
TCP
All of the above
49. A WCF service is exposed to the world as a collection of _____
endpoints
startpoints
stoppoints
none of the above
50. WCF is a framework for building _____
service-object applications
service-oriented applications
service-orignal applications
service-on applications
51. ___ are wcf binding types.
Basic Binding
Web Binding
TCP Binding
All of the above
52. SOAP stands for _____
Subjective, Objective, Answer and Plan
Subjective, Oriented, Assessment and Plan
Subjective, Objective, Assessment and Plan
Subway, Objective, Assessment and Plan
53. What attribute is used to define a wcf service class?
Service Contract
Operation Contract
Application Contract
none of the above
54. WCF Applications came into the picture in . Net for creating Service oriented Applications.
Yes
No
May be
Can't say
55. Which one is not a class in WCF?
Client binding
Http Binding
Http Context Binding
none of the above
56. The features of WCF are ____
Data contracts.
Durable messages
Service Metadata.
All of the above
57. What is Windows Communications Foundation HTTP Activation?
Wcf uses the listener adapter interface to communicate activation over the non-HTTP protocols.
Wcf uses the listener adapter interface to communicate activation over the HTTP protocols only.
Wcf uses .net to communicate activation over the non-HTTP protocols
none of the above
58. WCF exposes Service Meta Data using ____
Service Meta Data
Mex Endpoint
Both A and B
none of the above
59. Which of the following is not true?
A WCF Service can be consumed by
A WCF Service can perform calculations
Web applications A WCF Service can be consumed by Windows applications
A WCF Service cannot return a dataset
60. Which contract is applicable to interface in WCF?
Service Contract
Operation Contract
Application Contract
Data Contract
61. _____ are the various ways of hosting a WCF Service.
Self Hosting
IIS
WAS
All of the above
62. The main components of WCF services are _____
End point
service class
Hosting environment
All of the above
63. Advantages of WCF are ____
WCF provides interoperability between services.
WCF doesn't provides interoperability between services.
Small changes are not allowed
none of the above
64. WCF is a part of _______ .Net Framework.
5.0 and above
3.0 and above
1.0
2.0
65. In WCF,you can customize the different elements of the architecture to enable connections with any kind of non-Windows clients.
Yes
No
May be
Can't say
66. Which among the following is not a type of contract in wcf?
Service Contract
Operation Contract
Security Contract
none of the above
Submit