ContractFilter mismatch at the EndpointDispatcher due to endpoint transformation failed

193 Views Asked by At

I consumed a wcf soap service in a console application, I wanted to use the dev url in my app.config.

I always failed and the error was

ContractFilter mismatch at the EndpointDispatcher

I think the endpoint is not matching the wcf service url due to slow cheetah transformation failed.

 <endpoint address="http://wsvc01/xxxDev/xxx.svc" binding="basicHttpBinding"
            bindingConfiguration="BasicHttpBinding_ixxx" contract="xxxServiceReference.ixxx"
            name="BasicHttpBinding_ixxx" xdt:Transform="Replace" xdt:Locator="Match(address)" />
</client>

What I want is to replace address when debugging.

2

There are 2 best solutions below

0
On

If you want to configure your endpoint dynamically, you can't use the config file approach you're showing here. Rather, you configure all that stuff at run time as the program's starting, using variables to alter the URL of the web service endpoint based on conditions.

Here's a reference to the same topic here in Stackoverflow: WCF change endpoint address at runtime

Here's another link: http://www.packtpub.com/article/microsoft-wcf-hosting-and-configuration

0
On

Figured it out by myself via the help. Try SetAttributes transformation:

 <system.serviceModel>       
        <client>           
            <endpoint name="BasicHttpBinding_IMasterEngineService"
address="http://productionServer/WebServices/MasterEngine/MasterEngineService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService"
contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService"
xdt:Transform="SetAttributes(address)" xdt:Locator="Match(name)"/>
        </client>
    </system.serviceModel>