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

时间:2015-03-18 10:39:32   收藏:0   阅读:2224

最近在做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>


评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!