我收到以下错误,可以使用一些帮助来解决它。任何人都有什么想法?
由于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行为添加到服务配置中。