Which code segment should you use?
A. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation(Header header, int customerNumber); } [DataContract] public class CustomerInformation { ……. } [MessageContract] public class Header { [MessageHeader] public string SecurityTag; }
B. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation(Header header, int customerNumber); } [MessageContract] public class CustomerInformation { } [MessageContract] public class Header { [MessageHeader] public string SecurityTag; }
C. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation( CustomerNumber request); } [DataContract] public class CustomerInformation { } [MessageContract] public class CustomerNumber { [MessageHeader] public string SecurityTag; [MessageBodyMember] public int CustomerNumberElement; }
D. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation( CustomerNumber request); } [MessageContract] public class CustomerInformation { …… } [MessageContract] public class CustomerNumber { [MessageHeader] public string SecurityTag; [MessageBodyMember] public int CustomerNumberElement; }
Answer:D
Which code segment should you use?
A. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation(Header header, int customerNumber); } [DataContract] public class CustomerInformation { ……. } [MessageContract] public class Header { [MessageHeader] public string SecurityTag; } B. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation(Header header, int customerNumber); } [MessageContract] public class CustomerInformation { } [MessageContract] public class Header { [MessageHeader] public string SecurityTag; } C. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation( CustomerNumber request); } [DataContract] public class CustomerInformation { } [MessageContract] public class CustomerNumber { [MessageHeader] public string SecurityTag; [MessageBodyMember] public int CustomerNumberElement; } D. [ServiceContract] public interface IService { [OperationContract] CustomerInformation GetCustomerInformation( CustomerNumber request); } [MessageContract] public class CustomerInformation { …… } [MessageContract] public class CustomerNumber { [MessageHeader] public string SecurityTag; [MessageBodyMember] public int CustomerNumberElement; }