单声道:使用basichttpBinding的WCF服务超时(Mono 2.10.8.1)

时间:2012-10-28 15:51:31

标签: wcf mono wcf-client basichttpbinding

我正在使用带有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>

0 个答案:

没有答案