单项选择题
A Windows Communication Foundation (WCF) service implements the following contract.(Line numbers are included for reference only.)
01 [ServiceContract]
02 public interface IDataAccessService
03 {
04 [OperationContract]
05 void PutMessage(string message);
06 ...
07 [OperationContract]
08 [FaultContract(typeof(TimeoutFaultException))]
09 [FaultContract(typeof(FaultException))]
10 string SearchMessages(string search);
11 }
The implementation of the SearchMessages method throws TimeoutFaultException exceptions for database timeouts.The implementation of the SearchMessages method also throws an Exception for any other issue it encounters while processing the request.These exceptions are received on the client side as generic FaultException exceptions. You need to implement the error handling code for SearchMessages and create a new channel on the client only if the channel faults.What should you do?()
A. Catch and handle both TimeoutFaultException and FaultException.
B. Catch both TimeoutFaultException and FaultException. Create a new channel in both cases.
C. Catch and handle TimeoutFaultException. Catch FaultException and create a new channel.
D. Catch and handle FaultException. Catch TimeoutFaultException and create a new channel.
相关考题
-
单项选择题
A Windows Communication Foundation (WCF) solution exposes the following contract over an HTTP connection.[ServiceContract]public interface IDataService{ [OperationContract] string GetData();}Existing clients are making blocking calls to GetData. Calls to GetData take five seconds to complete.You need to allow new clients to issue non-blocking calls to get the data, without breaking any existing clients. What should you do?()
A.
B.
C.Generate a proxy class with asynchronous methods and use it for the new clients
D. Add a new endpoint to the service that uses a full-duplex binding and use it for the new clients. -
单项选择题
You are creating a Windows Communication Foundation (WCF) service. You have the following requirements: Messages must be sent over TCP The service must support transactions. Messages must be encoded using a binary encoding Messages must be secured using Windows stream-based security.You need to implement a custom binding for the service. In which order should the binding stack be configured?()
A. tcp Transport, windows Stream Security, transaction Flow, binary Message Encoding
B. transaction Flow, binary Message Encoding, windows Stream Security, tcp Transport
C. windows Stream Security, tcp Transport, binary Message Encoding, transaction Flow
D. binary Message Encoding, transaction Flow, tcp Transport, windows Stream Security -
单项选择题
A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service.You must ensure that the client application can interact with the WCF service. What should you do?()
A. On the OperationContractAttribute, set the AsyncPattern property value to true.
B. On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client.
C. On the client, create a proxy derived from DuplexClientBase<TChannel >.
D. On the client, use GetCallbackChannel<T >.
