由于AddressFilter在EndpointDispatcher不匹配,To 为“http://*/*”的消息无法在接收方处理。请检查发送方和接收方的 EndpointAddresses 是否一致

来源:互联网 发布:mac系统好玩的游戏 编辑:程序博客网 时间:2024/05/21 22:22

最近在做Android调用WCF服务的APP,WCF提供了RESTful风格的服务供移动端调用,相对于KSOAP2来说比较简洁方便,。

在用浏览器测试REST服务的时候提示错误信息:

由于 AddressFilter 在 EndpointDispatcher 不匹配,To 为“http://localhost:8006/rest/DoWork”的消息无法在接收方处理。请检查发送方和接收方的 EndpointAddresses 是否一致。


地址过滤器与终结点分发器不匹配,从而找不到相应的地址。Address是没有问题的,那么问题肯定出在终结点配置上。最终在终结点配置上加入behaviorConfiguration解决。如下所示

<endpoint address="rest" binding="webHttpBinding" behaviorConfiguration="webBehavior"  contract="SMS.IRest"></endpoint>

      <endpointBehaviors>        <behavior name="webBehavior">          <webHttp />        </behavior>      </endpointBehaviors>


1 1
原创粉丝点击