none
{"The operation has timed out"} RRS feed

  • Question

  • When calling WCF Service to upload data from client getting {"The operation has timed out"} error.

    client-side code 

    string sResult = webClient.UploadString("http://localhost:98/MedimizerAPIExportImport.svc/ReadWorkorderfromSerial/1/1d8435b839614e4b", "POST", data);

    WCF web config.

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
        <add key="EncryptionKey" value="AjikF45136qWd" />
    <add key="AppPath" value="E:\Trunck\PL\bin\Debug" />
        <add key="version" value="" />
        <add key="ReleaseDate" value="" />
        <add key="HospitalName" value="Demo" />
      </appSettings>
      <system.web>
        <compilation targetFramework="4.0" />
        <httpRuntime targetFramework="4.0"  />
            <authentication mode="Forms" />
      </system.web>
      <system.serviceModel>
        <services>
          <service name="MedimizerAPIExportImport" behaviorConfiguration="ServiceBehaviour">
            <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="webHttpBinding_IMedimizerAPIExportImport" contract="IMedimizerAPIExportImport" />
            <host>
              <baseAddresses>
               <add baseAddress="http://localhost:98/MedimizerAPIExportImport.svc" />
                <!--<add baseAddress="http://192.168.1.67:92/DatrendImportExport.svc"/>-->
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <endpointBehaviors>
            <behavior name="web">
              <webHttp />
       <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehaviour">
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
       <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
            <behavior name="">
              <serviceMetadata httpGetEnabled="true" />
         <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <webHttpBinding>
            <binding name="webHttpBinding_IMedimizerAPIExportImport" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" receiveTimeout="00:40:00" openTimeout="00:40:00" closeTimeout="00:40:00" sendTimeout="00:40:00">
              <readerQuotas maxDepth="214748364" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None" />
            </binding>
          </webHttpBinding>
        </bindings>
        <protocolMapping>
          <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
      </system.serviceModel>
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <!--
            To browse web app root directory during debugging, set the value below to true.
            Set to false before deployment to avoid disclosing web app folder information.
          -->
        <directoryBrowse enabled="true" />
      </system.webServer>
    </configuration>
    <!--ProjectGuid: {d1a23016-6a34-4d21-a44a-0a426f15465e}-->

    Tuesday, April 17, 2018 7:10 AM

Answers

  • I got the solution for RND on client side.

    we can solve this creating other class inherited WebClient class and set setter property for time out.

    this resolved my issue.

    Tuesday, April 17, 2018 5:49 PM