多项选择题
A. Use basicHttpBinding for both the client application and the service.
B. Create the persistence provider database and configure the persistenceProvider element of the service behavior to point to that database.
C. Use wsHttpContextBinding for both the client application and the service.
D. In the method to add an item to the shopping cart, serialize the shopping cart contents after adding the current item and storing it in a Session variable.
单项选择题 You are developing a Windows Communication Foundation (WCF) service.One of the service operations contains the following code.private static int counter = 0;[OperationContract]public void IncrementCount(){ counter++;}You need to set a service behavior that prevents two or more threads from incrementing the counter variable at the same time. Which code segment should you use to set the service behavior?()
单项选择题 You are developing a Windows Communication Foundation (WCF) service.One of the service operations contains the following code.private static int counter = 0;[OperationContract]public void IncrementCount(){ counter++;}You need to set a service behavior that prevents two or more threads from incrementing the counter variable at the same time. Which code segment should you use to set the service behavior?()
单项选择题 You are developing a Windows Communication Foundation (WCF) service.You enable message logging, trace listeners, activity propagation, and tracing on the trace sources.You have the following code segment in the client application. (Line numbers are included for reference only.) 01 Guid multiCallActivityId = Guid.NewGuid(); 02 TraceSource ts = new TraceSource("Multicall"); 03 Trace.CorrelationManager.ActivityId = multiCallActivityId; 04You encounter errors when your client application consumes the service.You need to ensure that your client application can correlate tracing information with the service. Which code segment should you add at line 04?()