多项选择题
A. Change the ServiceContract attribute of the IMyService interface to the following. [ServiceContract(SessionMode=SessionMode.Required)]
B. Change the ServiceContract attrbute of the IMyService interface to the following [ServiceContract(SessionMode=SessionMode.Allowed)]
C. Change the OperationContract attribute of the Initialize operation to the following. [OperationContract(IsInitiating = true, IsTerminating = false)]
D. Change the OperationContract attribute of the Terminate operation to the following [OperationContract(IsInitiating = false, IsTerminating = true)]
单项选择题 A Windows Communication Foundation (WCF) solution provides a session-based counter.The service is self-hosted. The hosting code is as follows: ServiceHost host = new ServiceHost(typeof(CounterService)); NetTcpBinding binding1 = new NetTcpBinding(SecurityMode.None); host.AddServiceEndpoint("MyApplication.ICounterService", binding1, "net.tcp://localhost:23456"); host.Open(); This service is currently exposed over TCP, but needs to be exposed to external clients over HTTP. Therefore, a new service endpoint is created with the following code:host.AddServiceEndpoint("MyApplication.ICounterService", binding2, "http://localhost:12345");You need to complete the implementation and ensure that the session-based counter will perform over HTTP as it does over TCP.What should you do?()
单项选择题 A Windows Communication Foundation (WCF) solution exposes the following service over a TCP binding.(Line numbers are included for reference only.) 01 [ServiceContract] 02 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)] 03 public class DataAccessService 04 { 05 [OperationContract] 06 public void PutMessage(string message) 07 { 08 MessageDatabase.PutMessage(message); 09 } 10 [OperationContract] 11 pubic string[] SearchMessages(string search) 12 { 13 return MessageDatabase.SearchMessages(search); 14 } 15 } MessageDatabase supports a limited number of concurrent executions of its methods. You need to change the service to allow up to the maximum number of executions of the methods of MessageDatabase. This should be implemented without preventing customers from connecting to the service. What should you do?()
单项选择题 You have a secured Windows Communication Foundation (WCF) service. You need to track unsuccessful attempts to access the service. What should you do?()