What should you do?
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?
Which interface should you implement in the data contract class?
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?
Which code segment should you use?
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?
What should you do?
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?