Resolving Configuration Error in WCF AddressFilter Mismatch
Asked Answered
A

1

18

I am getting the following error and could use some help resolving it. Anyone have any ideas?

The message with To 'http://localhost:60078/BidService.svc/Query' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.

The client configuration file is:

<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>

My Service Contract is:

[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();
}

My Service is configured as follows:

<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>

The one thing I read that you need to have the webHttp behavior which I've added. Any help would be appreciated. I just want a simple POX Service

Aristotle answered 4/12, 2008 at 2:16 Comment(0)
F
31

I think you need to add the webHttp behavior to the service configuration as well.

Fred answered 4/12, 2008 at 2:54 Comment(4)
I thought so but I don't think it's an option. It doesn;t show up in intellisense at least.Aristotle
Thanks I don't understand why they have ServiceBehaviors and EndpointBehaviors but this is now working...now to get my wcf client working.Aristotle
A service can have multiple endpoints; some behaviors are scoped to the whole service, whereas others work on a per-endpoint basis.Fred
Correct, if you decorate a ServiceContract with [WebInvoke] then you need to declare a <webHttp /> behavior inside your behaviors configurationMicroelement

© 2022 - 2024 — McMap. All rights reserved.