加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

.net – 解决WCF AddressFilter不匹配中的配置错误

发布时间:2020-12-16 08:01:31 所属栏目:百科 来源:网络整理
导读:我收到以下错误,可以使用一些帮助来解决它。任何人都有什么想法? 由于EndpointDispatcher上的AddressFilter不匹配,因此无法在接收器处理To’http://localhost:60078/BidService.svc/Query‘消息。检查发件人和接收者的EndpointAddresses是否一致。 客户端
我收到以下错误,可以使用一些帮助来解决它。任何人都有什么想法?

由于EndpointDispatcher上的AddressFilter不匹配,因此无法在接收器处理To’http://localhost:60078/BidService.svc/Query‘消息。检查发件人和接收者的EndpointAddresses是否一致。

客户端配置文件是:

<system.serviceModel>
    <bindings>
        <customBinding>
            <binding name="WebHttpBinding_IBidService">
                <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                    messageVersion="None" writeEncoding="utf-8">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" 
                                  maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                </textMessageEncoding>
                    <httpTransport manualAddressing="True" />
            </binding>
        </customBinding>
    </bindings>
    <client>
        <endpoint binding="customBinding" bindingConfiguration="WebHttpBinding_IBidService" 
                  behaviorConfiguration="IBidServiceBehavior"
            contract="myService.IBidService" name="WebHttpBinding_IBidService" />
    </client>
        <behaviors>
            <endpointBehaviors>
                <behavior name="IBidServiceBehavior">
                    <webHttp/>
                </behavior>
            </endpointBehaviors>
        </behaviors>
</system.serviceModel>

我的服务合同是:

[ServiceContract(Namespace = "http://xxxx.com/services/bids")]
public interface IBidService
{
    [OperationContract(Action = "*")]
    [WebGet(RequestFormat = WebMessageFormat.Xml,ResponseFormat = WebMessageFormat.Xml,BodyStyle = WebMessageBodyStyle.Wrapped)]
    List<BidSummary> Query();
}

我的服务配置如下:

<service name="xxx.Web.Services.Bids.BidService" 
          behaviorConfiguration="Cutter.Web.Services.Bids.BidServiceBehavior">
   <endpoint address="" binding="basicHttpBinding" 
             contract="xxx.Web.Services.Bids.IBidService" />                
   <endpoint address="mex" binding="mexHttpBinding" 
             contract="IMetadataExchange" />
</service>

<behavior name="Cutter.Web.Services.Bids.BidServiceBehavior">
   <serviceMetadata httpGetEnabled="true"  />
   <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

我读过的一件事,你需要有我添加的webHttp行为。任何帮助将不胜感激。我只想要一个简单的POX服务

我认为您还需要将webHttp行为添加到服务配置中。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读