none
Address Filter mismatch - WCF addressing

    Question

  • I keep receiving the following error from WCF:

     

    The message with To 'http://195.85.246.40/site10/WebHost1/WCFService1.svc' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.

     

    If I target the same service, but I use http://our-server/WebHost1/WCFService1.svc everything works out fine.  If I try to reach the service via the first method (the ip address) I try to access the service from outside the company and it passes via WebSEAL.  With the second method I access the service from the internal network.  So of course, there is a significant difference.   But I can't figure out the real problem and what's worse, I don't have a clue about how this could be configured somewhere in WCF.  The entire set-up of the server (including webSeal) is done as is has been done the past years for .Net 2.0 webservices.  Somehow WCF behaves in a different and it would help me a lot if someone could guide me in the right direction.

     

    We already traced what whas going on on the WebSEAL level, but for the system administrators, everything seemed to be working fine.

     

    Any help will be greatly appreciated!

     

    Kurt.

    Tuesday, July 03, 2007 7:31 AM

Answers

  • When web-hosted, the EndpointAddress of the service comes from the IIS base address (host headers).  In this case, it appears to be the "our-server" address.  By default, WCF ensures that the To of each Message matches the intended address.  If the service just has this one endpoint, a quick workaround would be to use
    [ServiceBehavior(AddressFilterMode=AddressFilterMode.Any)]

    which turns off the address filter.  Otherwise, ensure the IIS host headers contain the 'public facing base address' that you want clients to connect to, so that messages will be properly addressed to the service.

    http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.addressfiltermode.aspx

    Tuesday, July 03, 2007 8:49 AM

All replies

  • When web-hosted, the EndpointAddress of the service comes from the IIS base address (host headers).  In this case, it appears to be the "our-server" address.  By default, WCF ensures that the To of each Message matches the intended address.  If the service just has this one endpoint, a quick workaround would be to use
    [ServiceBehavior(AddressFilterMode=AddressFilterMode.Any)]

    which turns off the address filter.  Otherwise, ensure the IIS host headers contain the 'public facing base address' that you want clients to connect to, so that messages will be properly addressed to the service.

    http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicebehaviorattribute.addressfiltermode.aspx

    Tuesday, July 03, 2007 8:49 AM
  • Will this AddressFilter logic also trip if I have a https tunnel to our firewall which then contact the server using http?

    I.e. the client uses the URL https://myserver/myinterface, but the server is eventually invoked on http://myip/myinterface ?

    I'm not hosting using IIS at the moment, but I am baffled at how many of WCF's default settings make it near impossible to deploy my service on an Internet server. I shall try to keep my whining to a minimum, but lets just say I hope there are significant improvements in WCF 4.

    Wednesday, September 30, 2009 1:34 PM
  • you can write a servicehavior and config the app.config or web.config to use it

     

    Fix WCF AddressFilter mismatch error, customized IServiceBehavior , WCF service behind Load balancer or Firewall

    http://androidyou.blogspot.com/2010/09/fix-wcf-addressfilter-mismatch-error.html

    Wednesday, September 15, 2010 3:37 AM
  • I need your help on figuring out the addressing issue I have using Silverlight 4 to a WF4 XAMLX WCF Web Service.
     
    I've subclassed in Silverlight from the ServiceClient, setup a callback on Completed through this context, and then call the "Async" web service method.
    It comes back with:
     
    The message with To 'http://localhost:12345/MySite/Workflow/MyWorkflowService.xamlx/SOAP?wsdl' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.
     
    I've read that adding AddressMode.Any will fix this:
    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
     
    But I don't see how to apply this with a XAMLX unless possibly I write a full service that has that as an attribute on the class.
     
    Also, because we're using MEF, what normally would work fine (using the ServiceReferences.ClientConfig) does _not_ work.
    Like I mentioned above I use a subclass context to set the binding and endpoint correctly.
     
    But I'm not sure why I am getting this "AddressFilter mismatch at the EndpointDispatcher" error... or where to address it.
    If you have a clue post a reply and/or email me at danwygant on yahoo

     

    Thanks,

      Dan


    I answered my own question reading this:

    http://androidyou.blogspot.com/2010/09/fix-wcf-addressfilter-mismatch-error.html

     

    I implemented in the .Web project this very class. I added a slightly different entry that listed - since I'm doing WF4 WCF in a XAMLX file, the entries are more generic:

     

     <behaviors>
    	<serviceBehaviors>
    		<behavior>          
    			<serviceMetadata httpGetEnabled="true" httpGetUrl="SOAP" />
    			<serviceDebug includeExceptionDetailInFaults="false"/>
    			<matchalladdressfilter />
    		</behavior>
    	</serviceBehaviors>
    	<endpointBehaviors>
    		<behavior name="rest" >
    			<webHttp automaticFormatSelectionEnabled="false"
    					 helpEnabled="true"
    					 defaultOutgoingResponseFormat="Xml" />          
    		</behavior>        
    	</endpointBehaviors>
    
    </behaviors>
    <extensions>
     <behaviorExtensions>
    	<add name="matchalladdressfilter" type="MyNs.Web.OverrideAddressFilterModeElement, MyNs.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
     </behaviorExtensions>
    </extensions>
    

    Bottom line - this does the same as

    [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]

    Thanks again,

       Dan Wygant - Silverlight 4 stack: WCF RIA Services, WCF, WF4, Entity Framework, Sql Server 2008

    Thursday, August 11, 2011 2:57 PM