2012-12-04 33 views
1

運行時上下文: 一個WCF服務使用WSDualHttpBinding在Mono Linux上運行。 我使用的app.config,創建一個端點用過WSDualHttpBinding異常通過單聲道運行wsDualhttpbinding

的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 (關於細節信息,請看一看異常的快照) enter image description here

回答

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

我必須承認,我還沒有使用過WSDualHttpBinding在Windows上,所以我不知道是哪綁定它正在使用的元素(以及它們是否已經在Mono中實現)。這些綁定元素提供了核心功能,所以很難說需要多長時間才能實現這種綁定。

+0

WSDualHttpBinding現在不實現true的事實。 – vinogradniy