Microsoft TS: Windows Communication Foundation velopment with Microsoft .NET Framework 4 Sample Questions:
1. You are developing a data contract for a Windows Communication Foundation (WCF) service.
The data in the data contract must participate in round trips. Strict schema validity is not required.
You need to ensure that the contract is forward-compatible and allows new data members to be added to it.
Which interface should you implement in the data contract class?
A) IExtensibleObject<T>
B) IExtensibleDataObject
C) ICommunicationObject
D) IExtension<T>
2. Windows Communication Foundation (WCF) service will be hosted in Microsoft Intemnet Information Services (uS).
You create a new application in uS to host this service and copy the service DLL to the bin directory of the application.
You need to complete the deployment of this service to uS. What should you do next?
A) Create an asmx file and add a @ServiceHost directive to this file. Copy the file to the root of the application directory.
B) Create a svc file and add a @ServiceHost directive to this file Copy the file to the root of the application directory.
C) Create a .svc file and add a @Register directive to this file. Copy the file to the bin directory of the application.
D) Create an .asmx file and add a @Register directive to this file. Copy the file to the bin directory of the application.
3. You are developing a Windows Communication Foundation (WCF) service. One of the parameters used with the service operations is a security token. The security token is not sensitive. The monitoring software tracks security tokens and can read tokens in clear text only.
The company security policy requires that you validate all clear text data passed over the corporate network.
You need to ensure that the service verifies that the security token is not changed during transit.
What should you do?
A) For all the security-sensitive members, set the ProtectionLevel parameter of the MessageBodyMember or MessageHeader attribute to EncryptAndSign.
B) Implement IEndpointldentityProvider in the message contract class.
C) For all the security-sensitive members, set the ProtectionLevel parameter of the MessageBodyMember or MessageHeader attribute to Sign.
D) Implement ISecureConversationSession in the message contract class.
4. You are creating a Windows Communication Foundation (WCF) service. The service endpoints change frequently.
On the service, you add a new ServiceDiscoveryBehavior to the Behaviors collection of the ServiceHost Description property.
You need to ensure that client applications can communicate with the service and discover changes to the service endpoints.
What should you do?
A) Use the FindCriteria class and the UdpDiscoveryEndpoint class to set up the binding in the client application.
B) Use the DiscoveryProxy class and the EndpointDiscoveryMetadata class to set up the binding in the client application.
C) Add a new ServiceDiscoveryBehavior to the Behaviors collection in the client application.
D) Add a new AnnouncementClient to the Behaviors collection in the client application.
5. Your company has a Windows Communication Foundation (WCF) service at the URL http://services.contoso.com/OrderLookupService.svc.
The <system.serviceModel> section of the configuration file is as follows. (Line numbers are included for reference only.)
01 <system.serviceModel> 02 <behaviors> 03 <serviceBehaviors> 04 <behavior> 05 <serviceDebug includeExceptionDetailInFaults="false"/>
07 </behavior>
08 </serviceBehaviors>
09 </behaviors>
10 <serviceHostingEnvironmentmultipleSiteBindingsEnabled="true" />
11 </system.serviceModel>
You need to ensure that the service publishes the WSDL description at http://services.contoso.com/OrderLookupService.svc?wsdl.
What should you do?
A) Insert the following element at line 06.
<serviceDiscovery>
<announcementEndpoints>
<endpoint name="wsdlAnnouncement" kind="udpAnnouncementEndpoint" />
</announcementEndpoints>
</serviceDiscovery>
B) Insert the following element at line 06.
<serviceMetadata httpGetEnabled="true" />
C) Insert the following element at line 06.
<serviceMetadata httpGetEnabled="false" />
D) Change the serviceDebug element at line 05 as follows.
<serviceDebug includeExceptionDetailInFaults="true"/>
Solutions:
| Question # 1 Answer: B | Question # 2 Answer: B | Question # 3 Answer: C | Question # 4 Answer: A | Question # 5 Answer: B |
We're so confident of our products that we provide no hassle product exchange.


By Jill

