【问题标题】:Exception by wsDualhttpbinding running on Mono在 Mono 上运行的 wsDualhttpbinding 异常
【发布时间】:2012-12-04 01:25:47
【问题描述】:

运行时上下文: 一个 WCF 服务使用了 Mono 在 Linux 上运行的 WSDualHttpBinding。 我使用 app.config ,创建一个使用 WSDualHttpBinding 的 EndPoint

服务的app.config(部分)

 <endpoint address="http://192.168.0.101:8889"
              binding="wsDualHttpBinding" bindingConfiguration="wsDualHttp_Binding"
              contract="DynIPServiceContract.IDynIPService" />

服务代码:

     static void Main(string[] args)
    { 
        try
        {
            ServiceHost sh = new ServiceHost(typeof(DynIPService.DynIPService));
            sh.Open();
            foreach (var ep in sh.Description.Endpoints)
            {
                Console.WriteLine("Address: {0}, ListenUri: {1}, ListenUriMode: {2} ", ep.Address, ep.ListenUri, ep.ListenUriMode);
            }
            Console.WriteLine("Service is running");
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error:" + ex.Message);
            throw;
        }
        finally
        {
           Console.ReadKey();
        }
    }

例外: 属性“textEncoding”的默认值与属性本身的类型不同:预期 System.Text.Encoding 但为 System.String (有关详细信息,请查看异常快照)

【问题讨论】:

    标签: wcf mono wsdualhttpbinding


    【解决方案1】:

    嗯,我只是快速浏览了一下代码,这个异常实际上应该是你的问题中最少的;-)

    真正的问题是 Mono 还不支持 WSDualHttpBinding。

    CreateBindingElements()System.ServiceModel.Channels.Binding中一个重要的抽象方法,必须通过绑定来实现。

    mcs/class/System.ServiceModel/System.ServiceModel/WSDualHttpBinding.cs 最后一次更改是在 2008 年,它只是抛出一个 NotImplementedException

    https://github.com/mono/mono/blob/master/mcs/class/System.ServiceModel/System.ServiceModel/WSDualHttpBinding.cs#L140

    我必须承认我之前也没有在 Windows 上使用过 WSDualHttpBinding,所以我不知道它使用了哪些绑定元素(以及它们是否已经在 Mono 中实现)。这些绑定元素提供了核心功能,因此很难说实现这个绑定需要多长时间。

    【讨论】:

    • WSDualHttpBinding 现在没有实现的事实是真的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 2011-12-08
    • 1970-01-01
    相关资源
    最近更新 更多