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

我收到以下错误,可以使用一些帮助来解决它。任何人都有什么想法?

由于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行为添加到服务配置中。

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念