更多"You are implementing a Windows Comm"的相关试题:
[单项选择] You are working with a Windows Communication Foundation (WCF) client application that has a generated proxy named SampleServiceProxy.When the client application is executing, in line 04 of the following code, the channel faults (Line numbers are included for reference only.) 01 SampleServiceProxy proxy = new SampleServiceProxy( ); 02 try 03 { 04 proxy.ProcessInvoice(invoice); 05 } 06 catch 07 { 08 if(proxy.State == CommunicationState.Faulted) 09 { 10 ... 11 } 12 } 13 proxy.UpdateCustomer(customer);You need to return proxy to a state in which it can successfully execute the call in line 13.Which code segment should you use at line 10?()
A. proxy.Close();
B. proxy = new SampleServiceProxy();
C. proxy.Abort();
D. proxy.Open();
[单项选择]You have a self-hosted Windows Communication Foundation (WCF) service. You need to configure the service to provide an X509 certificate during authentication. What should you use to configure the service?()
A. the Certificate property of the X509 Certificate lnitiator Service Credential class
B. the SetCertificate method of the X509 Certificate Initiator Service Credential class
C. the SetCertificate method of the X509 Certificate Recipient Service Credential class
D. the TrustedStoreLocation property of the X509 Certificate Recipient Service Credential class
[单项选择] You are debugging a Windows Communication Foundation (WCF) service. The service uses signed and encrypted messages.You need to configure logging so that you can read the contents of the messages. What should you do?()
A. Set maxSizeMessagesToLog to 10
B. Set logMessageAtServiceLevel to true.
C. Set maxMessagesToLog to 10.
D. Set logMessageAtTransportLevel to true.
[单项选择] 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?()
A. Replace line 14 with the following line: throw;
B. Replace line 14 with the following line: throw new FaultException(anOrder, ex.ToString());
C. After line 05, add the following line: [FaultContract(typeof(FaultException))] Replace line 14 with the following line: throw ex;
D. Alter line 05, add the following line: [FaultContract(typeof(FaultException))] Replace line 14 with the following line: throw new FaultException(anOrder, "Divide by zero exception");
[单项选择]You are moving a Windows Communication Foundation (WCF) service into production. You need to be able to monitor the health of the service. You only want to enable all performance counter instances exposed by the ServiceModelService counter group. Which element should you add to the system.serviceModel section in the application configuration file?()
A.
B.
C.
D.
[单项选择] You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.[ServiceContract( )]public interface IPaymentService{ [OperationContract( )] void RecordPayments(Person person);}public class Person{ ... }public class Employee : Person{ ... }public class Customer : Person{ ... }You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?()
A. Add the following KnownType attribute to the Employee class and to the Customer class. [KnownType(GetType(Person))]
B. Implement the IExtensibleDataObject interface in the Person class.
C. Implement the IExtension(ofType(T)) interface in the Person class.
D. Add the following KnownType attributes to the Person class. [KnownType(GetType(Employee))] [KnownType(GetType(Customer))]