Which code segment should you insert at line 04?

You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment. (Line numbers are included for reference only.)

01 [ServiceContract(SessionMode=SessionMode.Required)]
02 public interface IOrderManager
03 {
05 void CloseOrder();
06 }

You need to decorate the operation as the method that closes the current session. Which code segment should you insert at line 04?

You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5. You write the following code segment. (Line numbers are included for reference only.)

01 [ServiceContract(SessionMode=SessionMode.Required)]
02 public interface IOrderManager
03 {
05 void CloseOrder();
06 }

You need to decorate the operation as the method that closes the current session. Which code segment should you insert at line 04?

A.
[OperationContract(IsInitiating=false)]

B.
[OperationContract(IsTerminating=true)]

C.
[OperationContract]
[OperationBehavior(ReleaseInstanceMode= ReleaseInstanceMode.AfterCall)]

D.
[OperationContract(IsTerminating=false)]
[OperationBehavior(ReleaseInstanceMode= ReleaseInstanceMode.AfterCall)]

Explanation:
IsTerminating: Gets or sets a value that indicates whether the service operation causes the server to close the session after the reply message, if any, is sent.

http://msdn.microsoft.com/en-us/library/ms576478(v=VS.100).aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *