WCF Fundamentals Quiz

Test your knowledge of Windows Communication Foundation (WCF) including bindings, security, REST services, hosting, and serialization.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Who are responsible for creating channels and receiving messages from the layer below or from the network?

  1. Channel Communication
  2. Channel Factory
  3. Channel Formatter
  4. Channel listeners
Question 2 Multiple Choice (Single Answer)

TransportWithMessageCredential is not available for the given binding?

  1. BasicHttpBinding
  2. WSFederationHttpBinding
  3. NetNamedPipeBinding
  4. WSHttpBinding
Question 3 Multiple Choice (Single Answer)

What is the default serialize for the WCF ?

  1. DataContractSerializer
  2. XMLSerializer
  3. DataContractFormatter
  4. None of the above
Question 4 Multiple Choice (Single Answer)

You are developing a Calculator service which performs mathematical operation. How you can enable session in your WCF Calculator Service?

  1. [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode=SessionMode.Required)] public interface ICalculator{ [OperationContract] double AddTo(double n); }
  2. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class CalculatorService : ICalculator { double result = 0.0D; public double AddTo(double n) { return result+=n; } }
  3. a and b both
  4. None of the above
Question 5 Multiple Choice (Single Answer)

Windows Communication Foundation service uses the net.tcp transport. You need to ensure that when the server starts, the service starts and continues to run. What should you do?

  1. Host the service in a Windows service
  2. Host the service in a Windows Presentation Foundation application
  3. Host the service under IIS 7.0 by using IIS 6.0 compatibility mode
  4. Host the service under IIS 7.0 by using Windows Activation Services
Question 6 Multiple Choice (Single Answer)

How to define a service as REST based service in WCF?

  1. [ServiceContract] interface IStock { [OperationContract] [WebGet] int GetStock(string StockId); }
  2. [ServiceContract] interface IStock { [OperationContract] [WebInvoke] int GetStock(string StockId); }
  3. a and b
  4. None
Question 7 Multiple Choice (Single Answer)

The client applications are unable to use SSL. You need to ensure that clients authenticate by using a token provided by a Security Token Service (STS). What should you do?

  1. Use a BasicHttpBinding binding with the security mode set to Message
  2. Use a BasicHttpBinding binding with the security mode set to TransportWithMessageCredential
  3. Use a WSFederationHttpBinding binding with the security mode set to Message
  4. Use a WSFederationHttpBinding binding with the security mode set to TransportWithMessageCredential
Question 8 Multiple Choice (Single Answer)

You are creating a distributed application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application. The operations provided by the WCF server use the remote resources of other computers. These methods use the credentials provided by the client applications. You need to ensure that the WCF server can impersonate the client applications to access the remote resources. Which client application settings should you use?

  1. <windows allowedImpersonationLevel="Delegation"/>
  2. <windows allowedImpersonationLevel="Impersonation"/>
  3. <windows allowedImpersonationLevel="Identification"/>
  4. <windows allowedImpersonationLevel="Impersonation" allowNtlm="false"/>
Question 9 Multiple Choice (Single Answer)

How can we implement transport security plus message security in WCF?

  1. <bindings> <wsHttpBinding> <binding name="Binding1"> <security mode="TransportWithMessageCredential" /> </security> </binding> </wsHttpBinding> </bindings>
  2. <bindings> <wsHttpBinding> <binding name="Binding1"> <security mode="TransportWithMessageCredential" > <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBin
  3. <wsHttpBinding> <binding name="WSHttpBinding_ICalculator"> <security mode="Message"> <message clientCredentialType="Certificate" /> </security> </binding> </wsHttpBinding>
  4. <bindings> <wsHttpBinding> <binding name="Binding1"> <security mode="MessageWithTransportCredential" > <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBin
Question 10 Multiple Choice (Single Answer)

In WCF, by default which binding does support the reliable session?

  1. basicHttpbinding
  2. wsDualHttpBinding
  3. wsHttpHttpBinding
  4. netTcpBinding
Question 11 Multiple Choice (Single Answer)

Which binding does not support the message streaming?

  1. basicHttpBinding
  2. netTcpBinding
  3. netNamedPipeBinding
  4. wsDualHttpBinding
Question 12 Multiple Choice (Single Answer)

What is the type of contract not available in WCF?

  1. Service Contract
  2. Operation Contract
  3. Data Contract
  4. Message Contract
  5. Exception Contract
Question 13 Multiple Choice (Single Answer)

What is the utility to test WCF services?

  1. WcfClient.exe
  2. WcfTestClient.exe
  3. WcfTestService.exe
  4. WcrTestRemoteService.exe
Question 14 Multiple Choice (Single Answer)

What is the namespace is used to access WCF service?

  1. System.Service
  2. System.Data
  3. System.ServiceModel
  4. System.Web
Question 15 Multiple Choice (Single Answer)

In order to create a Message Logger on the service side what interface will be required?

  1. IDispatchMessageInspector
  2. IAttachMessageInspector
  3. IlogMessageInspector
  4. IMessageInspector
Question 16 Multiple Choice (Single Answer)

What are the available security options for wsHttpBinding binding?

  1. Transport security with Windows authentication
  2. Message security with issuetoken authentication
  3. Message security with Windows authentication
  4. No security
Question 17 Multiple Choice (Single Answer)

What is the default mapping for http protocol in WCF 4.0 ?

  1. basicHttpBinding
  2. wsHttpBinding
  3. WebHttpBinding
  4. None
Question 18 Multiple Choice (Single Answer)

In which model, services publish their presence in a network by multicasting announcement message that can be processed by the interested consumers?

  1. Managed Model
  2. Ad-Hoc Model
  3. Echo Model
  4. Discovery Model
Question 19 Multiple Choice (Single Answer)

Which class should be used to Handle exception in WCF Web Http Services(RESTFull Service)?

  1. FaultException
  2. RESTException
  3. WebFaultException
  4. WebHttpFaultException
Question 20 Multiple Choice (Single Answer)

How many process templates by default supported in TFS?

  1. 2
  2. 3
  3. 4
  4. 5