Microsoft
70-513 · Question #68
70-513 Question #68: Real Exam Question with Answer & Explanation
The correct answer is A. DataContractSerializer s = new DataContractSerializer(typeof(Item));. See the full explanation below for the reasoning.
Question
You are consuming a Windows Communication Foundation (WCF) service. The service interface is defined as follows: [DataContract(Namespace = ''] public class Item { } [ServiceContract(Namespace = '')] public interface Catalog { [OperationContract] [WebInvoke(Method="POST", UriTemplate="{Item}")] Item UpdateItem(Item item); } The client application receives a WebResponse named response with the response from the service. You need to deserialize this response into a strongly typed object representing the return value of the method. Which code segment should you use?
Options
- ADataContractSerializer s = new DataContractSerializer(typeof(Item));
- BBinaryFormatter f = new BinaryFormatter();
- CXmlDictionaryReader r = JsonReaderWriterFactory.CreateJsonReader(
- DDataContractJsonSerializer s = new DataContractJsonSerializer
Community Discussion
No community discussion yet for this question.