WCF Fundamentals Quiz
Test your knowledge of Windows Communication Foundation (WCF) including bindings, security, REST services, hosting, and serialization.
Questions
Who are responsible for creating channels and receiving messages from the layer below or from the network?
- Channel Communication
- Channel Factory
- Channel Formatter
- Channel listeners
TransportWithMessageCredential is not available for the given binding?
- BasicHttpBinding
- WSFederationHttpBinding
- NetNamedPipeBinding
- WSHttpBinding
What is the default serialize for the WCF ?
- DataContractSerializer
- XMLSerializer
- DataContractFormatter
- None of the above
You are developing a Calculator service which performs mathematical operation. How you can enable session in your WCF Calculator Service?
- [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode=SessionMode.Required)] public interface ICalculator{ [OperationContract] double AddTo(double n); }
- [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] public class CalculatorService : ICalculator { double result = 0.0D; public double AddTo(double n) { return result+=n; } }
- a and b both
- None of the above
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?
- Host the service in a Windows service
- Host the service in a Windows Presentation Foundation application
- Host the service under IIS 7.0 by using IIS 6.0 compatibility mode
- Host the service under IIS 7.0 by using Windows Activation Services
How to define a service as REST based service in WCF?
- [ServiceContract] interface IStock { [OperationContract] [WebGet] int GetStock(string StockId); }
- [ServiceContract] interface IStock { [OperationContract] [WebInvoke] int GetStock(string StockId); }
- a and b
- None
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?
- Use a BasicHttpBinding binding with the security mode set to Message
- Use a BasicHttpBinding binding with the security mode set to TransportWithMessageCredential
- Use a WSFederationHttpBinding binding with the security mode set to Message
- Use a WSFederationHttpBinding binding with the security mode set to TransportWithMessageCredential
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?
- <windows allowedImpersonationLevel="Delegation"/>
- <windows allowedImpersonationLevel="Impersonation"/>
- <windows allowedImpersonationLevel="Identification"/>
- <windows allowedImpersonationLevel="Impersonation" allowNtlm="false"/>
How can we implement transport security plus message security in WCF?
- <bindings> <wsHttpBinding> <binding name="Binding1"> <security mode="TransportWithMessageCredential" /> </security> </binding> </wsHttpBinding> </bindings>
- <bindings> <wsHttpBinding> <binding name="Binding1"> <security mode="TransportWithMessageCredential" > <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBin
- <wsHttpBinding> <binding name="WSHttpBinding_ICalculator"> <security mode="Message"> <message clientCredentialType="Certificate" /> </security> </binding> </wsHttpBinding>
- <bindings> <wsHttpBinding> <binding name="Binding1"> <security mode="MessageWithTransportCredential" > <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBin
In WCF, by default which binding does support the reliable session?
- basicHttpbinding
- wsDualHttpBinding
- wsHttpHttpBinding
- netTcpBinding
Which binding does not support the message streaming?
- basicHttpBinding
- netTcpBinding
- netNamedPipeBinding
- wsDualHttpBinding
What is the type of contract not available in WCF?
- Service Contract
- Operation Contract
- Data Contract
- Message Contract
- Exception Contract
What is the utility to test WCF services?
- WcfClient.exe
- WcfTestClient.exe
- WcfTestService.exe
- WcrTestRemoteService.exe
What is the namespace is used to access WCF service?
- System.Service
- System.Data
- System.ServiceModel
- System.Web
In order to create a Message Logger on the service side what interface will be required?
- IDispatchMessageInspector
- IAttachMessageInspector
- IlogMessageInspector
- IMessageInspector
What are the available security options for wsHttpBinding binding?
- Transport security with Windows authentication
- Message security with issuetoken authentication
- Message security with Windows authentication
- No security
What is the default mapping for http protocol in WCF 4.0 ?
- basicHttpBinding
- wsHttpBinding
- WebHttpBinding
- None
In which model, services publish their presence in a network by multicasting announcement message that can be processed by the interested consumers?
- Managed Model
- Ad-Hoc Model
- Echo Model
- Discovery Model
Which class should be used to Handle exception in WCF Web Http Services(RESTFull Service)?
- FaultException
- RESTException
- WebFaultException
- WebHttpFaultException
How many process templates by default supported in TFS?
- 2
- 3
- 4
- 5