多项选择题
A WCF service code is implemented as follows. (Line numbers are included for reference only)
01 [ServiceContract]
02 [ServiceBehavior(InstanceContextMode =
03 InstanceContextMode.Single)]
04 public class CalculatorService
05 {
06 [OperationContract]
07 public double Calculate(double op1, string op, double op2)
08 {
09 }
10 }
You need to increase the rate by which clients get the required response from the service. What are two possble ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)()
A.
B.
C.
D.
相关考题
-
单项选择题
A service implements the following contract. (Line numbers are included for reference only) 01 [ServiceContract(SessionMode = SessionMode.Required)] 02 public interface IContosoService 03 { 04 [OperationContract(IsOneWay = true, IsInitiating = true)] 05 void OperationOne(string value); 06 07 [OperationContract(IsOneWay = true, IsInitiating = false)] 08 void OperationTwo(string value); 09 }The service is implemented as follows: 10 class ContosoService: IContosoService 11 { 12 public void OperationOne(string value) {...} 13 ... 14 public void OperationTwo(string value) {...} 15 } ContosoService uses NetMsmqBinding to listen for messages. The queue was set up to use transactions for adding and removing messages.You need to ensure that OperationOne and OperationTwo execute under the same transaction context when they are invoked in the same session.What should you do?()
A.
B.
C.
D. -
单项选择题
A Windows Communication Foundation (WCF) client and service share the following service contract interface: [ServiceContract] public interface IContosoService { [OperationContract] void SavePerson(Person person); } They also use the following binding: NetTcpBinding binding = new NetTcpBinding() { TransactionFlow = true }; The client calls the service with the following code: using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required)) { IContosoService client = factory.CreateChannel(); client.SavePerson(person); Console.WriteLine(Transaction.Current.TransactionInformation.DistributedIdentifier); ts.Complete(); } The service has the following implementation for SavePerson: public void IContosoService.SavePerson(Person person) { person.Save(); Console.WriteLine(Transaction.Current.TransactionInformation.DistributedIdentifier); } The distributed identifiers do not match on the client and the server. You need to ensure that the client and server enlist in the same distributed transaction. What should you do?()
A.
B.
C.
D. -
多项选择题
A Windows Communication Foundation (WCF) solution uses the following contract: [ServiceContract(SessionMode=SessionMode.Allowed)]public interface IMyService{ [OperationContract(IsTerminating=false)] void Initialize(); [OperationContract(IsInitiating=false)] void DoSomething(); [OperationContract(IsTerminating=true)] void Terminate();} You need to change this interface so that: lnitialize is allowed to be called at any time before Terminate is called. DoSomething is allowed to be called only after Initialize is called, and not allowed to be called after Terminate is called. Terminate will be allowed to be called only after Initalize is called.Which two actions should you perform? (Each correct answer presents part of the sdution. Choose two)()。
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)]
