单项选择题
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.
B.
C.
D.
相关考题
-
单项选择题
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?()
A. Change the service behavior as follows. [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)]
B. Change the service behavior as follows. [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerSession)]
C. Add a throttling behavior to the service, and configure the maxConcurrentCalls.
D. Add a throttling behavior to the service, and configure the maxConcurrentSessions. -
单项选择题
You have a secured Windows Communication Foundation (WCF) service. You need to track unsuccessful attempts to access the service. What should you do?()
A. Set the authorization Manager Type attribute of the service Authorization behavior to Message.
B. Set the include Exception Detailsln Faults attribute of the service Debug behavior to true.
C. Set the Mode attribute of the security configuration element to Message.
D. Set the message Authentication AuditLevel attribute of the service Security Audit behavior to Failure. -
单项选择题
A Windows Communication Foundation (WCF) service that handles corporate accounting must be changed to comply with government regulations of auditing and accountability. You need to configure the WCF service to execute under the Windows logged-on identity of the calling application.What should you do?()
A. Within the service configuration, add a Service Authorization behavior to the service, and set Impersonate Caller For All Operations to true.
B. Within the service configuration, add a Service Authentication Manager behavior to the service, and set Service Authentication Manager Type to Impersonate.
C. Within the service configuration, add a serviceSecurityAudit behavior to the service, and set service Authorization AuditLevel to Success Or Failure.
D. Within the service configuration, add a ServiceCredentials behavior to the service, and set type to Impersonate.
