在“标准”WCF 服务上,我只需将操作方法标记为:
[OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
但是对于我的数据服务,一旦打开 DataServiceHost,我就会收到 InvalidOperationException:
The service operation 'ProcessRequestForMessage' that belongs to the contract with the 'IRequestHandler' name and the 'http://tempuri.org/' namespace does not allow impersonation.
如何标记“ProcessRequestForMessage”以允许模拟?