【发布时间】:2016-09-07 19:58:33
【问题描述】:
在 WCF 安全性中,给定当前 OperationContext,确定请求是 SOAP 请求还是 REST 请求的最佳方法是什么?
【问题讨论】:
标签: wcf rest soap operationcontext
在 WCF 安全性中,给定当前 OperationContext,确定请求是 SOAP 请求还是 REST 请求的最佳方法是什么?
【问题讨论】:
标签: wcf rest soap operationcontext
您可以查看 ChannelDispatcher 上的绑定名称:
string bindingName = OperationContext.Current
.EndpointDispatcher.ChannelDispatcher.BindingName;
对于 REST,它将是 webHttpBinding - 其他任何东西都是 SOAP。
【讨论】: