You are creating a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You write the following code segment to create a service contract. (Line numbers are included for reference only.)
01
02 public interface IMyContract
03 {
04 [OperationContract]
05 void MyMethod();
06 }
You need to ensure that the client applications always use a binding that supports sessions.
Which code segment should you insert at line 01?
A.
[ServiceContract(SessionMode = SessionMode.Required)]
B.
[ServiceContract(SessionMode = SessionMode.Allowed)]
C.
[ServiceContract(ProtectionLevel=ProtectionLevel.EncryptAndSign)]
D.
[ServiceContract(
ProtectionLevel=ProtectionLevel.EncryptAndSign
SessionMode= SessionMode.Allowed)
)]