私はbasicHTTPBindingでWCFクライアントを持っています。Windowsで実行している場合、それは正常に機能しています。しかし、Mono (Debian 2.10.8.1-5、Mono JIT コンパイラ バージョン 2.10.8.1) から実行すると、すぐにタイムアウトになります。
Unhandled Exception: System.TimeoutException: The operation has timed-out.
at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd () [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TimeoutException: The operation has timed-out.
at System.ServiceModel.Channels.HttpRequestChannel+HttpChannelRequestAsyncResult.WaitEnd () [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.EndRequest (IAsyncResult result) [0x00000] in <filename unknown>:0
at System.ServiceModel.Channels.HttpRequestChannel.Request (System.ServiceModel.Channels.Message message, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Channels.Message msg, TimeSpan timeout) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Request (System.ServiceModel.Description.OperationDescription od, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.DoProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.ServiceModel.MonoInternal.ClientRuntimeChannel.Process (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters) [0x00000] in <filename unknown>:0
他の(Windowsベースの)クライアントから実行されるため、ネットワーク接続の問題ではないことをすでに確認しました。また、アプリケーションは設定された 1 分のタイムアウトを待機していません。
サービスを呼び出すために使用しているコードは次のとおりです。
// Application Authentication
DiscoveryService.LDEDiscoveryServiceClient client = new DiscoveryService.LDEDiscoveryServiceClient();
client.InnerChannel.OperationTimeout = TimeSpan.FromMinutes(1);
Console.WriteLine("Connecting to: " + client.Endpoint.Address.Uri);
string token = client.GetTokenV1();
Console.WriteLine(token);
そして、バインディング構成の app.config:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ILDEDiscoveryService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/>
<binding name="BasicHttpBinding_ILDEDeviceService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://hostname/LDE/DiscoveryService/LDEDiscoveryService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILDEDiscoveryService" contract="DiscoveryService.ILDEDiscoveryService" name="BasicHttpBinding_ILDEDiscoveryService"/>
<endpoint address="http://hostname/LDE/DeviceService/LDEDeviceService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ILDEDeviceService" contract="DeviceService.ILDEDeviceService" name="BasicHttpBinding_ILDEDeviceService"/>
</client>
</system.serviceModel>
</configuration>