单选题You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows:[ServiceContract]public interface IMessageProcessor { [OperationContract] void ProcessMessages( );}public class MessageProcessor: IMessageProcessor { public void ProcessMessage( ); SubmitOrder( );}SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests,or when it is waiting for calls to SubmitOrder to return.Which attribute should you apply to the MessageProcessor class?()ACallbackBehavior(ConcurrencyMode=ConcurencyMode.Reentrant)BCallbackBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)CServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)DServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)

单选题
You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows:[ServiceContract]public interface IMessageProcessor { [OperationContract] void ProcessMessages( );}public class MessageProcessor: IMessageProcessor { public void ProcessMessage( ); SubmitOrder( );}SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests,or when it is waiting for calls to SubmitOrder to return.Which attribute should you apply to the MessageProcessor class?()
A

CallbackBehavior(ConcurrencyMode=ConcurencyMode.Reentrant)

B

CallbackBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)

C

ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)

D

ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)


参考解析

解析: 暂无解析

相关考题:

You are developing a Windows Comunication Foundation (WCF) service that is used to check the status of orders placed by customers.The following code segment is part of your service.(Line numbers are included for reference only.)01 [ServiceContract]02 public interface IStatus03 {04 [OperationContract]05 int GetOrderStatus(string orderNumber);06 }0708 class OrderService : IStatus09 {10 public int GetOrderStatus(string orderNumber)11 {12 ...13 }14 }1516 class Program17 {18 static void Main(string[] args)19 {202122 host.Open();23 ...24 }25 }You need to ensure that the service always listens at net.pipe://SupplyChainServer/Pipe.What should you do?()A.B.C.D.

You are developing a Windows Communication Foundation (WCF) service. The following code defines and implements the service. (Line numbers are included for reference only.)01 [ServiceContract(SessionMode = SessionMode.Allowed)]02 public interface ICatchAll03 {04 [OperationContract(IsOneWay = false, Action = *, ReplyAction = *)]05 Message ProcessMessage(Message message);06 }0708 public class CatchAllService : ICatchAll09 {10 public Message ProcessMessage(Message message)11 {1213 ...14 return returnMsg;15 }16 }You need to ensure that two identical copies of the received message are created in the service.Which code segment should you insert at line 12?()A.B.C.D.

You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache for many Web applications.The service contract is defined as follows. (Line numbers are included for reference only.)01 [ServiceContract]02 public interface IDataCache03 {04 ...05 }060708 public class DataCache : IDataCache09 {10 ...11 }You need to ensure that all users share the cache.Which code segment should you insert at line 07?()A. [ServiceBehavior(TransactionIsolationLevel = IsolationLevel.RepeatableRead)]B. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]C. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]D. [ServiceBehavior(TransactionIsolationLevel = IsolationLevel.ReadComitted)]

You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data. The client applications call the service in a transaction. The service contract is defined as follows. (Line numbers are included for reference only.)01 [ServiceContract]02 public interface IDataUpdate03 {04 [OperationContract]05 [TransactionFlow(TransactionFlowOption.Mandatory)]06 void Update(string accountNumber, double amount);07 }0809 ...10 class UpdateService : IDataUpdate11 {12 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]13 public void Update(string accountNumber, double amount)14 {15 try16 {17 ...18 }19 catch(Exception ex)20 {21 WriteErrorLog(ex);22 ...23 }24 }25 }26Customers report that the transaction completes successfully even if the Update method throws an exception.You need to ensure that the transaction is aborted if the Update method is not successful.What should you do? ()

You are developing a Windows Communication Foundation (WCF) service to replace an existing ASMX Web service.The WCF service contains the following code segment. (Line numbers are included for reference only.)01 [ServiceContract()]0203 public interface IEmployeeService04 {05 [OperationContract()]06 EmployeeInfo GetEmployeeInfo(int employeeID);0708 }0910 public class EmployeeService : IEmployeeService11 {1213 public EmployeeInfo GetEmployeeInfo(int employeeID)14 {15 ...16 }17 }181920 public class EmployeeInfo21 {22 ...23 public int EmployeeID { get; set; }24 public string FirstName { get; set; }25 public string LastName { get; set; }2627 }The existing Web service returns the EmployeelD as an attribute of the Employeelnfo element in the response XML.You need to ensure that applications can consume the service without code changes in the client.What should you do?()

You develop a Windows Communication Foundation (WCF) service to generate reports. Client applications call the service to initiate report generation but do not wait for the reports to be generated. The service does not provide any status to the client applications. The service class is defined as follows. (Line numbers are included for reference only.)01 [ServiceContract]02 public class ReportGeneratorService03 {04 ...05 private int GenerateReports(int clientID)06 {07 ...08 return 0;09 }10 }You need to ensure that client applications can initiate reports without waiting for status.Which two actions should you perform (Each correct answer presents part of the solution. Choose two.) ()。A. Insert the following code at line 04. [OperationContract(IsOneWay=true)]B. Insert the following code at line 04. [OperationContract(AsyncPattern=false)]C. At line 05, change the GenerateReports method from private to public.D. Remove line 08. At line 05, change the return type of GenerateReports method to void.

A Windows Communication Foundation (WCF) service has the following contract:[ServiceContract]public class ContosoService{ [OperationContract] [TransactionFlow(TransactionFlowOption.Mandatory)] [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=false)] void TxOp1(string value) {... };[OperationContract(IsTerminating=true)] [TransactionFlow(TransactionFlowOption.Mandatory)] [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=false)] void TxOp2(string value) { ... OperationContext.Current.SetTransactionComplete();}}The service and the clients that call the service use NetTcpBinding with transaction flow enabled. You need to configure the service so that when TxOp1 and TxOp2 are invoked under the same client session, they run under the same transaction context. 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 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 clientsD. Add a new endpoint to the service that uses a full-duplex binding and use it for the new clients.

A Windows Communication Foundation (WCF) service implements the following contract. [ServiceContract] public interface IHelloService { [OperationContract(WebGet(UriTemplate="hello?name={name}"))] A.B.C.D.

You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows:[ServiceContract]public interface IMessageProcessor { [OperationContract] void ProcessMessages();}public class MessageProcessor: IMessageProcessor { public void ProcessMessage(); SubmitOrder();}SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests,or when it is waiting for calls to SubmitOrder to return.Which attribute should you apply to the MessageProcessor class?()A. CallbackBehavior(ConcurrencyMode=ConcurencyMode.Reentrant)B. CallbackBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)C. ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)D. ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)

A Windows Communication Foundation (WCF) service uses the following service contract. [ServiceContract] public interface IService{ [OperationContract] string Operation1(string s);}You need to ensure that the operation contract Operation1 responds to HTTP POST requests.Which code segment should you use?()A.B.C.D.

You are developing a client that sends several types of SOAP messages to a Windows Communication Foundation (WCF) service method named PostData. PostData is currently defined as follows:[OperationContract]void PostData(Order data);You need to modify PostData so that it can receive any SOAP message. Which code segment should you use?()A. [OperationContract(IsOneWay=true, Action=*, ReplyAction=*)] void PostData(Order data);B. [OperationContract(IsOneWay=true, Action=*, ReplyAction = *)] void PostData(BodyWriter data);C. [OperationContract] void PostData(BodyWriter data);D. [OperationContract] void PostData(Message data);

You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows:[ServiceContract]public interface IMessageProcessor { [OperationContract] void ProcessMessages( );}public class MessageProcessor: IMessageProcessor { public void ProcessMessage( ); SubmitOrder( );}SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests,or when it is waiting for calls to SubmitOrder to return.Which attribute should you apply to the MessageProcessor class?()A、CallbackBehavior(ConcurrencyMode=ConcurencyMode.Reentrant)B、CallbackBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)C、ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)D、ServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)

You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.[ServiceContract]public interface IOrderProcessing { [OperationContract] void ApproveOrder(int id);}You need to ensure that only users with the Manager role can call the ApproveOrder method. What should you do?()A、In the method body, check the Rights PosessesProperty property to see if it contains ManagerB、Add a PrincipalPermission attribute to the method and set the Roles property to ManagerC、Add a SecurityPermission attribute to the method and set the SecurityAction to DemandD、In the method body, create a new instance of WindowsClaimSet. Use the FindClaims method to locate a claimType named Role with a right named Manager

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)]

You are developing a client that sends several types of SOAP messages to a Windows Communication Foundation (WCF) service method named PostData. PostData is currently defined as follows:[OperationContract]void PostData(Order data);You need to modify PostData so that it can receive any SOAP message. Which code segment should you use?()A、[OperationContract(IsOneWay=true, Action="*", ReplyAction="*")] void PostData(Order data);B、[OperationContract(IsOneWay=true, Action="*", ReplyAction = "*")] void PostData(BodyWriter data);C、[OperationContract] void PostData(BodyWriter data);D、[OperationContract] void PostData(Message data);

You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache for many Web applications.The service contract is defined as follows. (Line numbers are included for reference only.) 01 [ServiceContract] 02 public interface IDataCache 03 { 04 ... 05 }06 07 08 public class DataCache : IDataCache 09 { 10 ... 11 } You need to ensure that all users share the cache. Which code segment should you insert at line 07?()A、[ServiceBehavior(TransactionIsolationLevel = IsolationLevel.RepeatableRead)]B、[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]C、[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]D、[ServiceBehavior(TransactionIsolationLevel = IsolationLevel.ReadComitted)]

You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.[ServiceContract( )]public interface IPaymentService{ [OperationContract( )] void RecordPayments(Person person);}public class Person{ ... }public class Employee : Person{ ... }public class Customer : Person{ ... }You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?()A、Add the following KnownType attribute to the Employee class and to the Customer class. [KnownType(GetType(Person))]B、Implement the IExtensibleDataObject interface in the Person class.C、Implement the IExtension(ofType(T)) interface in the Person class.D、Add the following KnownType attributes to the Person class. [KnownType(GetType(Employee))] [KnownType(GetType(Customer))]

You develop a Windows Communication Foundation (WCF) service to generate reports. Client applications call the service to initiate report generation but do not wait for the reports to be generated. The service does not provide any status to the client applications. The service class is defined as follows. (Line numbers are included for reference only.) 01 [ServiceContract] 02 public class ReportGeneratorService 03 { 04 ... 05 private int GenerateReports(int clientID) 06 { 07 ... 08 return 0; 09 } 10 } You need to ensure that client applications can initiate reports without waiting for status. Which two actions should you perform (Each correct answer presents part of the solution. Choose two.) ()。A、Insert the following code at line 04. [OperationContract(IsOneWay=true)]B、Insert the following code at line 04. [OperationContract(AsyncPattern=false)]C、At line 05, change the GenerateReports method from private to public.D、Remove line 08. At line 05, change the return type of GenerateReports method to void.

You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data. The service contract is defined as follows. (Line numbers are included for reference only) 01 [ServiceContract] 02 public interface IDataUpdate 03 { 04 [OperationContract] 05 [TransactionFlow(TransactionFlowOption.Mandatory)] 06 void Update(string accountNumber, double amount); 07 } 08 09 class UpdateService : IDataUpdate 10 { 11 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = false)] 12 public void Update(string accountNumber, double amount) 13 { 14 ... 15 } 16 } 17 You need to ensure that the service is invoked within the transaction. What should you do?()A、Replace line 01 with the following code [ServiceContract(SessionMode = SessionMode.NotAllowed)]B、Replace line 01 with the following code [ServiceContract(SessionMode = SessionMode.Required)]C、Call the Invoke method of the form and supply a delegate.D、Call the BeginInvoke method of the form and supply a delegate.

单选题You are developing a Windows Communication Foundation (WCF) service to replace an existing ASMX Web service.The WCF service contains the following code segment. (Line numbers are included for reference only.) 01 [ServiceContract( )] 02 03 public interface IEmployeeService 04 { 05 [OperationContract( )] 06 EmployeeInfo GetEmployeeInfo(int employeeID); 07 08 } 09 10 public class EmployeeService : IEmployeeService 11 { 12 13 public EmployeeInfo GetEmployeeInfo(int employeeID) 14 { 15 ... 16 } 17 } 18 19 20 public class EmployeeInfo 21 { 22 ... 23 public int EmployeeID { get; set; } 24 public string FirstName { get; set; } 25 public string LastName { get; set; } 26 27 }The existing Web service returns the EmployeelD as an attribute of the Employeelnfo element in the response XML.You need to ensure that applications can consume the service without code changes in the client. What should you do?()AInsert the following code at line 02. [DataContractFormat()] Insert the following code at line 22. [DataMember()]BInsert the following code at line 02. [XmlSerializerFormat()] Insert the following code at line 22. [XmlAtttibute()]CInsert the following code at line 09. [XmlSerializerFormat()] Insert the following code at line 22. [XmlAttribute()]DInsert the following code at line 19. [DataContractFormat()] Insert the following code at line 22. [DataMember()]

单选题You are creating a Windows Communication Foundation (WCF) service that implements the following service contract.[ServiceContract]public interface IOrderProcessing { [OperationContract] void ApproveOrder(int id);}You need to ensure that only users with the Manager role can call the ApproveOrder method. What should you do?()AIn the method body, check the Rights PosessesProperty property to see if it contains ManagerBAdd a PrincipalPermission attribute to the method and set the Roles property to ManagerCAdd a SecurityPermission attribute to the method and set the SecurityAction to DemandDIn the method body, create a new instance of WindowsClaimSet. Use the FindClaims method to locate a claimType named Role with a right named Manager

单选题You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.[ServiceContract( )]public interface IPaymentService{ [OperationContract( )] void RecordPayments(Person person);}public class Person{ ... }public class Employee : Person{ ... }public class Customer : Person{ ... }You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. What should you do?()AAdd the following KnownType attribute to the Employee class and to the Customer class. [KnownType(GetType(Person))]BImplement the IExtensibleDataObject interface in the Person class.CImplement the IExtension(ofType(T)) interface in the Person class.DAdd the following KnownType attributes to the Person class. [KnownType(GetType(Employee))] [KnownType(GetType(Customer))]

单选题You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache for many Web applications.The service contract is defined as follows. (Line numbers are included for reference only.) 01 [ServiceContract] 02 public interface IDataCache 03 { 04 ... 05 }06 07 08 public class DataCache : IDataCache 09 { 10 ... 11 } You need to ensure that all users share the cache. Which code segment should you insert at line 07?()A[ServiceBehavior(TransactionIsolationLevel = IsolationLevel.RepeatableRead)]B[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]C[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]D[ServiceBehavior(TransactionIsolationLevel = IsolationLevel.ReadComitted)]

单选题You are developing a client that sends several types of SOAP messages to a Windows Communication Foundation (WCF) service method named PostData. PostData is currently defined as follows:[OperationContract]void PostData(Order data);You need to modify PostData so that it can receive any SOAP message. Which code segment should you use?()A[OperationContract(IsOneWay=true, Action=*, ReplyAction=*)] void PostData(Order data);B[OperationContract(IsOneWay=true, Action=*, ReplyAction = *)] void PostData(BodyWriter data);C[OperationContract] void PostData(BodyWriter data);D[OperationContract] void PostData(Message data);

单选题You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows:[ServiceContract]public interface IMessageProcessor { [OperationContract] void ProcessMessages( );}public class MessageProcessor: IMessageProcessor { public void ProcessMessage( ); SubmitOrder( );}SubmitOrder makes a call to another service. The ProcessMessage method does not perform as expected under a heavy load.You need to enable processing of multiple messages. New messages must only be processed when the ProcessMessage method is not processing requests,or when it is waiting for calls to SubmitOrder to return.Which attribute should you apply to the MessageProcessor class?()ACallbackBehavior(ConcurrencyMode=ConcurencyMode.Reentrant)BCallbackBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)CServiceBehavior(ConcurrencyMode=ConcurrencyMode.Reentrant)DServiceBehavior(ConcurrencyMode=ConcurrencyMode.Multiple)

单选题You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data. The service contract is defined as follows. (Line numbers are included for reference only) 01 [ServiceContract] 02 public interface IDataUpdate 03 { 04 [OperationContract] 05 [TransactionFlow(TransactionFlowOption.Mandatory)] 06 void Update(string accountNumber, double amount); 07 } 08 09 class UpdateService : IDataUpdate 10 { 11 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = false)] 12 public void Update(string accountNumber, double amount) 13 { 14 ... 15 } 16 } 17 You need to ensure that the service is invoked within the transaction. What should you do?()AReplace line 01 with the following code [ServiceContract(SessionMode = SessionMode.NotAllowed)]BReplace line 01 with the following code [ServiceContract(SessionMode = SessionMode.Required)]CCall the Invoke method of the form and supply a delegate.DCall the BeginInvoke method of the form and supply a delegate.