【问题标题】:ContractFilter mismatch at the EndpointDispatcher due to endpoint transformation failed由于端点转换失败,EndpointDispatcher 的 ContractFilter 不匹配
【发布时间】:2014-01-25 16:26:21
【问题描述】:

我在控制台应用程序中使用了 wcf soap 服务,我想在我的 app.config 中使用 dev url。

我总是失败,错误是

EndpointDispatcher 的 ContractFilter 不匹配

我认为端点与 wcf 服务 url 不匹配,由于 cheetah 转换缓慢而失败。

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

我想要的是调试时替换地址。

【问题讨论】:

    标签: xml wcf slowcheetah


    【解决方案1】:

    我自己通过help 解决了这个问题。 尝试 SetAttributes 转换:

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

    【讨论】:

      【解决方案2】:

      如果您想动态配置端点,则不能使用此处显示的配置文件方法。相反,您可以在程序启动时在运行时配置所有这些内容,使用变量根据条件更改 Web 服务端点的 URL。

      这是对 Stackoverflow 中相同主题的引用: WCF change endpoint address at runtime

      这是另一个链接: http://www.packtpub.com/article/microsoft-wcf-hosting-and-configuration

      【讨论】:

        猜你喜欢
        • 2013-02-21
        • 1970-01-01
        • 2014-04-16
        • 2013-03-09
        • 2011-07-26
        • 1970-01-01
        • 1970-01-01
        • 2011-03-28
        • 2018-07-05
        相关资源
        最近更新 更多