1.
You are creating a Windows Communication Foundation (WCF) service that is implemented as follows. (Line numbers are included for reference only.) 01 [ServiceContract] 02 [ServiceBehavior(IncludeExceptionDetailsInFaults = true)] 03 public class OrderService 04 { 05 [OperationContract] 06 public void SubmitOrder(Order anOrder) 07 { 08 try 09 { 10 ... 11 } 12 catch(DivideByZeroException ex) 13 { 14 ... 15 } 16 } 17 } You need to ensure that the stack trace details of the exception are not included in the error information sent to the client. What should you do?
2.
You are creating a Windows Communication Foundation (WCF) service. You do not want to expose the internal implementation at the service layer. You need to expose the following class as a service named Arithmetic with an operation named Sum: public class Calculator { public int Add(int x, int y) { } } Which code segment should you use?
3.
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?
4.
A Windows Communication Foundation (WCF) application uses a data contract that has several data members. You need the application to throw a SerializationException if any of the data members are not present when a serialized instance of the data contract is deserialized. What should you do?
5.
You are developing a client that sends several types of SOAP messages to a Windows Communication Foundation (WCF) service method named PostData. PostData is currently defined as follows: [OperationContract] void PostData(Order data); You need to modify PostData so that it can receive any SOAP message. Which code segment should you use?
6.
A class named TestService implements the following interface: [ServiceContract] public interface ITestService { [OperationContract] DateTime GetServiceTime(); } TestService is hosted in an ASP.NET application. You need to modify the application to allow the GetServiceTime method to return the data formatted as JSON. It must do this only when the request URL ends in /ServiceTime. What should you do?
7.
You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation. You implement the delete method as follows: void DeleteItems(string id); You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. What should you do?
8.
You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows: [ServiceContract] public interface IMessageProcessor { [OperationContract] void ProcessMessages(); } public class MessageProcessor: IMessageProcessor { public void ProcessMessage(); SubmitOrder(); } SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load. You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests, or when it is waiting for calls to SubmitOrder to return. Which attribute should you apply to the MessageProcessor class?
9.
A Windows Communication Foundation (WCF) service listens for messages at net.tcp://www.contoso.com/ MyService. It has a logical address at http://www.contoso.com/MyService. The configuration for the WCF client is as follows: The generated configuration does not provide enough information for the client to communicate with the server. You need to update the client so that it can communicate with the server. What should you do?
10.
You are building a client for a Windows Communication Foundation (WCF) service. You need to create a proxy to consume this service. Which class should you use?