WCF ServiceHost REST API goes idle after some time, returns timeout error





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















We are facing a production-issue with WCF REST API hosted in a Windows Service.



We have clients making GET and PUT requests and also regular Ping() requests to the service from clients every 30 sec.



All the Get,Put requests work well for some time (2 or 3 days) and later at some point no WEB-API requests are served. We had to restart the Windows service again to bring back the REST-service into working state.



Client Error msg: Status Code is 503 service unavailable.



Able to reproduce the issue in local Dev-environment by below scenario.



Simulated continuous REST calls to service in local with the help of sample test client upon making Ping request every 2 seconds and Put request every 4 Seconds continuously we are able to reproduce the issue within 5 Minutest after making 68 Put requests and 152 Get requests . There was no errors logged in service. Status Code is 503 service unavailable.



Here is the server configuration for WCF REST service.



WCF REST Service Configuration:





var restURL = string.Format("{0}{1}/v{2}", (isHttps ? WsSprotocol : WsProtocol), Config.Server, Config.Version);
var webServiceHost = new WebServiceHost(typeof(EngageWebServiceHostREST), new Uri(restURL));

var webHttpBinding = new WebHttpBinding
{
Security = new WebHttpSecurity { Mode = isHttps ? WebHttpSecurityMode.Transport : WebHttpSecurityMode.None },
MaxReceivedMessageSize = int.MaxValue,
ReaderQuotas = { MaxArrayLength = int.MaxValue },
OpenTimeout = new TimeSpan(0, 01, 00),
CloseTimeout = new TimeSpan(0, 10, 00),
SendTimeout = new TimeSpan(0, 10, 00),
CrossDomainScriptAccessEnabled = true,
TransferMode = TransferMode.StreamedResponse
};

if (isHttps)
{
bindHttpCertificate(webServiceHost);

if (webServiceHost.Credentials.ServiceCertificate != null && webServiceHost.Credentials.ServiceCertificate.Certificate != null)
{
webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
Log.Info(string.Format("Https Certificate {0} binded to {1}", webServiceHost.Credentials.ServiceCertificate.Certificate.SubjectName.Name, restURL));
}
}

var customBinding = new CustomBinding(webHttpBinding);

for (int counter = 0; counter < customBinding.Elements.Count; counter++)
{
if (customBinding.Elements[counter] is WebMessageEncodingBindingElement)
{
WebMessageEncodingBindingElement webBE = (WebMessageEncodingBindingElement)customBinding.Elements[counter];
customBinding.Elements[counter] = new GZipMessageEncodingBindingElement(webBE);
}
else if (customBinding.Elements[counter] is TransportBindingElement)
{
((TransportBindingElement)customBinding.Elements[counter]).MaxReceivedMessageSize = int.MaxValue;
}
}

ServiceEndpoint endpoint = webServiceHost.AddServiceEndpoint(typeof(IEngageWebServiceREST), customBinding, "");

endpoint.Behaviors.Add(new WebHttpBehavior() { AutomaticFormatSelectionEnabled = true, DefaultOutgoingResponseFormat = WebMessageFormat.Json });
endpoint.Behaviors.Add(new EnableCrossOriginResourceSharingBehavior());
endpoint.Behaviors.Add(new HelpPageEndPointBehavior("Product Suite"));

var serviceDebugBehaviorLocal = webServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
if (serviceDebugBehaviorLocal == null)
{
webServiceHost.Description.Behaviors.Add(new ServiceDebugBehavior
{
IncludeExceptionDetailInFaults = true
});
}
else
{
if (!serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults)
serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults = true;

}


Await and appreciate ideas & thoughts to troubleshoot/resolve this issue.



Thanks,



Dileep










share|improve this question































    0















    We are facing a production-issue with WCF REST API hosted in a Windows Service.



    We have clients making GET and PUT requests and also regular Ping() requests to the service from clients every 30 sec.



    All the Get,Put requests work well for some time (2 or 3 days) and later at some point no WEB-API requests are served. We had to restart the Windows service again to bring back the REST-service into working state.



    Client Error msg: Status Code is 503 service unavailable.



    Able to reproduce the issue in local Dev-environment by below scenario.



    Simulated continuous REST calls to service in local with the help of sample test client upon making Ping request every 2 seconds and Put request every 4 Seconds continuously we are able to reproduce the issue within 5 Minutest after making 68 Put requests and 152 Get requests . There was no errors logged in service. Status Code is 503 service unavailable.



    Here is the server configuration for WCF REST service.



    WCF REST Service Configuration:





    var restURL = string.Format("{0}{1}/v{2}", (isHttps ? WsSprotocol : WsProtocol), Config.Server, Config.Version);
    var webServiceHost = new WebServiceHost(typeof(EngageWebServiceHostREST), new Uri(restURL));

    var webHttpBinding = new WebHttpBinding
    {
    Security = new WebHttpSecurity { Mode = isHttps ? WebHttpSecurityMode.Transport : WebHttpSecurityMode.None },
    MaxReceivedMessageSize = int.MaxValue,
    ReaderQuotas = { MaxArrayLength = int.MaxValue },
    OpenTimeout = new TimeSpan(0, 01, 00),
    CloseTimeout = new TimeSpan(0, 10, 00),
    SendTimeout = new TimeSpan(0, 10, 00),
    CrossDomainScriptAccessEnabled = true,
    TransferMode = TransferMode.StreamedResponse
    };

    if (isHttps)
    {
    bindHttpCertificate(webServiceHost);

    if (webServiceHost.Credentials.ServiceCertificate != null && webServiceHost.Credentials.ServiceCertificate.Certificate != null)
    {
    webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
    Log.Info(string.Format("Https Certificate {0} binded to {1}", webServiceHost.Credentials.ServiceCertificate.Certificate.SubjectName.Name, restURL));
    }
    }

    var customBinding = new CustomBinding(webHttpBinding);

    for (int counter = 0; counter < customBinding.Elements.Count; counter++)
    {
    if (customBinding.Elements[counter] is WebMessageEncodingBindingElement)
    {
    WebMessageEncodingBindingElement webBE = (WebMessageEncodingBindingElement)customBinding.Elements[counter];
    customBinding.Elements[counter] = new GZipMessageEncodingBindingElement(webBE);
    }
    else if (customBinding.Elements[counter] is TransportBindingElement)
    {
    ((TransportBindingElement)customBinding.Elements[counter]).MaxReceivedMessageSize = int.MaxValue;
    }
    }

    ServiceEndpoint endpoint = webServiceHost.AddServiceEndpoint(typeof(IEngageWebServiceREST), customBinding, "");

    endpoint.Behaviors.Add(new WebHttpBehavior() { AutomaticFormatSelectionEnabled = true, DefaultOutgoingResponseFormat = WebMessageFormat.Json });
    endpoint.Behaviors.Add(new EnableCrossOriginResourceSharingBehavior());
    endpoint.Behaviors.Add(new HelpPageEndPointBehavior("Product Suite"));

    var serviceDebugBehaviorLocal = webServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
    if (serviceDebugBehaviorLocal == null)
    {
    webServiceHost.Description.Behaviors.Add(new ServiceDebugBehavior
    {
    IncludeExceptionDetailInFaults = true
    });
    }
    else
    {
    if (!serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults)
    serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults = true;

    }


    Await and appreciate ideas & thoughts to troubleshoot/resolve this issue.



    Thanks,



    Dileep










    share|improve this question



























      0












      0








      0








      We are facing a production-issue with WCF REST API hosted in a Windows Service.



      We have clients making GET and PUT requests and also regular Ping() requests to the service from clients every 30 sec.



      All the Get,Put requests work well for some time (2 or 3 days) and later at some point no WEB-API requests are served. We had to restart the Windows service again to bring back the REST-service into working state.



      Client Error msg: Status Code is 503 service unavailable.



      Able to reproduce the issue in local Dev-environment by below scenario.



      Simulated continuous REST calls to service in local with the help of sample test client upon making Ping request every 2 seconds and Put request every 4 Seconds continuously we are able to reproduce the issue within 5 Minutest after making 68 Put requests and 152 Get requests . There was no errors logged in service. Status Code is 503 service unavailable.



      Here is the server configuration for WCF REST service.



      WCF REST Service Configuration:





      var restURL = string.Format("{0}{1}/v{2}", (isHttps ? WsSprotocol : WsProtocol), Config.Server, Config.Version);
      var webServiceHost = new WebServiceHost(typeof(EngageWebServiceHostREST), new Uri(restURL));

      var webHttpBinding = new WebHttpBinding
      {
      Security = new WebHttpSecurity { Mode = isHttps ? WebHttpSecurityMode.Transport : WebHttpSecurityMode.None },
      MaxReceivedMessageSize = int.MaxValue,
      ReaderQuotas = { MaxArrayLength = int.MaxValue },
      OpenTimeout = new TimeSpan(0, 01, 00),
      CloseTimeout = new TimeSpan(0, 10, 00),
      SendTimeout = new TimeSpan(0, 10, 00),
      CrossDomainScriptAccessEnabled = true,
      TransferMode = TransferMode.StreamedResponse
      };

      if (isHttps)
      {
      bindHttpCertificate(webServiceHost);

      if (webServiceHost.Credentials.ServiceCertificate != null && webServiceHost.Credentials.ServiceCertificate.Certificate != null)
      {
      webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
      Log.Info(string.Format("Https Certificate {0} binded to {1}", webServiceHost.Credentials.ServiceCertificate.Certificate.SubjectName.Name, restURL));
      }
      }

      var customBinding = new CustomBinding(webHttpBinding);

      for (int counter = 0; counter < customBinding.Elements.Count; counter++)
      {
      if (customBinding.Elements[counter] is WebMessageEncodingBindingElement)
      {
      WebMessageEncodingBindingElement webBE = (WebMessageEncodingBindingElement)customBinding.Elements[counter];
      customBinding.Elements[counter] = new GZipMessageEncodingBindingElement(webBE);
      }
      else if (customBinding.Elements[counter] is TransportBindingElement)
      {
      ((TransportBindingElement)customBinding.Elements[counter]).MaxReceivedMessageSize = int.MaxValue;
      }
      }

      ServiceEndpoint endpoint = webServiceHost.AddServiceEndpoint(typeof(IEngageWebServiceREST), customBinding, "");

      endpoint.Behaviors.Add(new WebHttpBehavior() { AutomaticFormatSelectionEnabled = true, DefaultOutgoingResponseFormat = WebMessageFormat.Json });
      endpoint.Behaviors.Add(new EnableCrossOriginResourceSharingBehavior());
      endpoint.Behaviors.Add(new HelpPageEndPointBehavior("Product Suite"));

      var serviceDebugBehaviorLocal = webServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
      if (serviceDebugBehaviorLocal == null)
      {
      webServiceHost.Description.Behaviors.Add(new ServiceDebugBehavior
      {
      IncludeExceptionDetailInFaults = true
      });
      }
      else
      {
      if (!serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults)
      serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults = true;

      }


      Await and appreciate ideas & thoughts to troubleshoot/resolve this issue.



      Thanks,



      Dileep










      share|improve this question
















      We are facing a production-issue with WCF REST API hosted in a Windows Service.



      We have clients making GET and PUT requests and also regular Ping() requests to the service from clients every 30 sec.



      All the Get,Put requests work well for some time (2 or 3 days) and later at some point no WEB-API requests are served. We had to restart the Windows service again to bring back the REST-service into working state.



      Client Error msg: Status Code is 503 service unavailable.



      Able to reproduce the issue in local Dev-environment by below scenario.



      Simulated continuous REST calls to service in local with the help of sample test client upon making Ping request every 2 seconds and Put request every 4 Seconds continuously we are able to reproduce the issue within 5 Minutest after making 68 Put requests and 152 Get requests . There was no errors logged in service. Status Code is 503 service unavailable.



      Here is the server configuration for WCF REST service.



      WCF REST Service Configuration:





      var restURL = string.Format("{0}{1}/v{2}", (isHttps ? WsSprotocol : WsProtocol), Config.Server, Config.Version);
      var webServiceHost = new WebServiceHost(typeof(EngageWebServiceHostREST), new Uri(restURL));

      var webHttpBinding = new WebHttpBinding
      {
      Security = new WebHttpSecurity { Mode = isHttps ? WebHttpSecurityMode.Transport : WebHttpSecurityMode.None },
      MaxReceivedMessageSize = int.MaxValue,
      ReaderQuotas = { MaxArrayLength = int.MaxValue },
      OpenTimeout = new TimeSpan(0, 01, 00),
      CloseTimeout = new TimeSpan(0, 10, 00),
      SendTimeout = new TimeSpan(0, 10, 00),
      CrossDomainScriptAccessEnabled = true,
      TransferMode = TransferMode.StreamedResponse
      };

      if (isHttps)
      {
      bindHttpCertificate(webServiceHost);

      if (webServiceHost.Credentials.ServiceCertificate != null && webServiceHost.Credentials.ServiceCertificate.Certificate != null)
      {
      webHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
      Log.Info(string.Format("Https Certificate {0} binded to {1}", webServiceHost.Credentials.ServiceCertificate.Certificate.SubjectName.Name, restURL));
      }
      }

      var customBinding = new CustomBinding(webHttpBinding);

      for (int counter = 0; counter < customBinding.Elements.Count; counter++)
      {
      if (customBinding.Elements[counter] is WebMessageEncodingBindingElement)
      {
      WebMessageEncodingBindingElement webBE = (WebMessageEncodingBindingElement)customBinding.Elements[counter];
      customBinding.Elements[counter] = new GZipMessageEncodingBindingElement(webBE);
      }
      else if (customBinding.Elements[counter] is TransportBindingElement)
      {
      ((TransportBindingElement)customBinding.Elements[counter]).MaxReceivedMessageSize = int.MaxValue;
      }
      }

      ServiceEndpoint endpoint = webServiceHost.AddServiceEndpoint(typeof(IEngageWebServiceREST), customBinding, "");

      endpoint.Behaviors.Add(new WebHttpBehavior() { AutomaticFormatSelectionEnabled = true, DefaultOutgoingResponseFormat = WebMessageFormat.Json });
      endpoint.Behaviors.Add(new EnableCrossOriginResourceSharingBehavior());
      endpoint.Behaviors.Add(new HelpPageEndPointBehavior("Product Suite"));

      var serviceDebugBehaviorLocal = webServiceHost.Description.Behaviors.Find<ServiceDebugBehavior>();
      if (serviceDebugBehaviorLocal == null)
      {
      webServiceHost.Description.Behaviors.Add(new ServiceDebugBehavior
      {
      IncludeExceptionDetailInFaults = true
      });
      }
      else
      {
      if (!serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults)
      serviceDebugBehaviorLocal.IncludeExceptionDetailInFaults = true;

      }


      Await and appreciate ideas & thoughts to troubleshoot/resolve this issue.



      Thanks,



      Dileep







      rest wcf service






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 5 at 6:35







      Dileep Namburu

















      asked Jan 3 at 8:57









      Dileep NamburuDileep Namburu

      1415




      1415
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I suggest you refer to the following configuration.



          <system.serviceModel>
          <services>
          <service behaviorConfiguration="Service1Behavior" name="VM1.MyService">
          <endpoint address="" binding="webHttpBinding" contract="VM1.IService" behaviorConfiguration="rest" bindingConfiguration="mybinding" >
          </endpoint>
          <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          </services>
          <bindings>
          <webHttpBinding>
          <binding name="mybinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <security mode="Transport">
          <transport clientCredentialType="None"></transport>
          </security>
          </binding>
          </webHttpBinding>
          </bindings>
          <behaviors>
          <serviceBehaviors>
          <behavior name="Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
          </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
          <behavior name="rest">
          <webHttp/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
          </endpointBehaviors>
          </behaviors>
          </system.serviceModel>


          Feel free to let me know if the problem still exists.






          share|improve this answer
























          • Thanks for the suggestion.

            – Dileep Namburu
            Jan 7 at 10:43












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019040%2fwcf-servicehost-rest-api-goes-idle-after-some-time-returns-timeout-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I suggest you refer to the following configuration.



          <system.serviceModel>
          <services>
          <service behaviorConfiguration="Service1Behavior" name="VM1.MyService">
          <endpoint address="" binding="webHttpBinding" contract="VM1.IService" behaviorConfiguration="rest" bindingConfiguration="mybinding" >
          </endpoint>
          <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          </services>
          <bindings>
          <webHttpBinding>
          <binding name="mybinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <security mode="Transport">
          <transport clientCredentialType="None"></transport>
          </security>
          </binding>
          </webHttpBinding>
          </bindings>
          <behaviors>
          <serviceBehaviors>
          <behavior name="Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
          </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
          <behavior name="rest">
          <webHttp/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
          </endpointBehaviors>
          </behaviors>
          </system.serviceModel>


          Feel free to let me know if the problem still exists.






          share|improve this answer
























          • Thanks for the suggestion.

            – Dileep Namburu
            Jan 7 at 10:43
















          0














          I suggest you refer to the following configuration.



          <system.serviceModel>
          <services>
          <service behaviorConfiguration="Service1Behavior" name="VM1.MyService">
          <endpoint address="" binding="webHttpBinding" contract="VM1.IService" behaviorConfiguration="rest" bindingConfiguration="mybinding" >
          </endpoint>
          <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          </services>
          <bindings>
          <webHttpBinding>
          <binding name="mybinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <security mode="Transport">
          <transport clientCredentialType="None"></transport>
          </security>
          </binding>
          </webHttpBinding>
          </bindings>
          <behaviors>
          <serviceBehaviors>
          <behavior name="Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
          </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
          <behavior name="rest">
          <webHttp/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
          </endpointBehaviors>
          </behaviors>
          </system.serviceModel>


          Feel free to let me know if the problem still exists.






          share|improve this answer
























          • Thanks for the suggestion.

            – Dileep Namburu
            Jan 7 at 10:43














          0












          0








          0







          I suggest you refer to the following configuration.



          <system.serviceModel>
          <services>
          <service behaviorConfiguration="Service1Behavior" name="VM1.MyService">
          <endpoint address="" binding="webHttpBinding" contract="VM1.IService" behaviorConfiguration="rest" bindingConfiguration="mybinding" >
          </endpoint>
          <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          </services>
          <bindings>
          <webHttpBinding>
          <binding name="mybinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <security mode="Transport">
          <transport clientCredentialType="None"></transport>
          </security>
          </binding>
          </webHttpBinding>
          </bindings>
          <behaviors>
          <serviceBehaviors>
          <behavior name="Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
          </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
          <behavior name="rest">
          <webHttp/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
          </endpointBehaviors>
          </behaviors>
          </system.serviceModel>


          Feel free to let me know if the problem still exists.






          share|improve this answer













          I suggest you refer to the following configuration.



          <system.serviceModel>
          <services>
          <service behaviorConfiguration="Service1Behavior" name="VM1.MyService">
          <endpoint address="" binding="webHttpBinding" contract="VM1.IService" behaviorConfiguration="rest" bindingConfiguration="mybinding" >
          </endpoint>
          <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          </services>
          <bindings>
          <webHttpBinding>
          <binding name="mybinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" sendTimeout="00:10:00" receiveTimeout="00:10:00">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" />
          <security mode="Transport">
          <transport clientCredentialType="None"></transport>
          </security>
          </binding>
          </webHttpBinding>
          </bindings>
          <behaviors>
          <serviceBehaviors>
          <behavior name="Service1Behavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
          </behavior>
          </serviceBehaviors>
          <endpointBehaviors>
          <behavior name="rest">
          <webHttp/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
          </endpointBehaviors>
          </behaviors>
          </system.serviceModel>


          Feel free to let me know if the problem still exists.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 7 at 6:21









          Abraham QianAbraham Qian

          1,079119




          1,079119













          • Thanks for the suggestion.

            – Dileep Namburu
            Jan 7 at 10:43



















          • Thanks for the suggestion.

            – Dileep Namburu
            Jan 7 at 10:43

















          Thanks for the suggestion.

          – Dileep Namburu
          Jan 7 at 10:43





          Thanks for the suggestion.

          – Dileep Namburu
          Jan 7 at 10:43




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54019040%2fwcf-servicehost-rest-api-goes-idle-after-some-time-returns-timeout-error%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          Npm cannot find a required file even through it is in the searched directory

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith