A Windows Communication Foundation (WCF) service exposes two operations: OpA and OpB.
OpA needs to execute under the client’s identity, and OpB needs to execute under the service’s identity.
You need to configure the service to run the operations under the correct identity. What should you do?
A.
Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to true.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Required.
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.Allowed.
B.
Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to true.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Allowed.
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.NotAllowed.
C.
Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to false.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Allowed.
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.NotAllowed.
D.
Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to false.
Apply an OperationBehavior attribute to OpA and set the Impersonation property to lmpersonationOption.Required.
Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.Allowed.
Explanation:
Delegation and Impersonation with WCF
(http://msdn.microsoft.com/en-us/library/ms730088%28v=VS.90%29.aspx)
Why not B?
bc the combination of ImpersonateCallerForAllServiceOperations=true and NotAllowed throws InvalidOperationException
C