tags:

views:

6094

answers:

1

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

+4  A: 

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

Brian
I thought so but I don't think it's an option. It doesn;t show up in intellisense at least.
JoshBerke
See http://blogs.msdn.com/bags/archive/2008/06/09/rest-in-wcf-part-iv-hi-rest-exposing-a-service-via-get-configuring-the-service.aspx
Brian
Thanks I don't understand why they have ServiceBehaviors and EndpointBehaviors but this is now working...now to get my wcf client working.
JoshBerke
A service can have multiple endpoints; some behaviors are scoped to the whole service, whereas others work on a per-endpoint basis.
Brian