【发布时间】:2011-07-09 20:59:04
【问题描述】:
当我尝试使用 webHttpBinding 服务从网络浏览器连接到我的 WCF 时,我遇到了这个奇怪的错误:
Sendera:ActionNotSupported 由于 EndpointDispatcher 的 ContractFilter 不匹配,接收方无法处理带有 Action '' 的消息。这可能是因为合约不匹配(发送方和接收方之间的操作不匹配)或发送方和接收方之间的绑定/安全不匹配。检查发送方和接收方是否具有相同的合同和相同的绑定(包括安全要求,例如消息、传输、无)。
我的 app.config:
<services>
<service name="MyNamespace.MyService">
<host>
<baseAddresses>
<add baseAddress="http://localhost:9091/MyService/" />
</baseAddresses>
</host>
<endpoint address="" binding="webHttpBinding" contract="MyNamespace.IMyService" />
</service>
</services>
我的方法看起来像这样:
[WebGet(UriTemplate = "foo/{id}")]
public string GetFoo(string id)
{ ...
【问题讨论】: