简体   繁体   中英

ContractFilter mismatch at the EndpointDispatcher due to endpoint transformation failed

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.

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

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM