【发布时间】:2011-03-16 00:46:18
【问题描述】:
我有一个 WCF 4.0 REST 服务应用程序,我想拦截传入请求并检查自定义标头。在我的解决方案中,我使用以下默认端点
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
我已尝试创建 IDispatchMessageInspector 和相应的 BehaviorExtensionElement,并将适当的 behaviorExtension 和 endPointBehavior 添加到我的 web.config。我还需要做什么才能让拦截器着火?
我假设我完全缺乏对 WCF 实际运作的了解,这让我很生气。我的 IParameterInspector 很容易实现并且运行良好。我希望这会很容易实现。
【问题讨论】: