none
WCF Service TCP Binding TimeOut RRS feed

  • Question

  • Dear Team,

    We Changed the Binding HTTP to TCP In our project. Report was working fine in the HTTP Binding. but after implementation TCP is shows timeout error in case of huge amount of data and report is working fine with HTTP Binding. i have done required changes.

    please find the TCP Binding Details :_

     <bindings>
          <netTcpBinding>
            <binding name="TCPBinding"  maxBufferSize="2147483647" maxBufferPoolSize="2147483647"  transferMode="Buffered"  receiveTimeout="00:55:00" closeTimeout="00:55:00" sendTimeout="00:55:00" maxReceivedMessageSize="2147483647">
              <!--<reliableSession inactivityTimeout="00:10:00" enabled="true" />-->
       <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
                  <!-- <security mode="None" />-->
            </binding>             
          </netTcpBinding>
        </bindings>

    please suggest to me. how can be resolved this issue. i am waiting the positive response from your side AS Soon As Possible.


    Monday, October 7, 2019 7:47 AM

All replies

  • Hi,
    Timeout doesn’t completely indicate that there is something wrong with the binding settings. It is also possible that the connection is faulty, such as the essential windows feature is not enabled.
    https://i.stack.imgur.com/AEddz.png
    https://i.stack.imgur.com/TzXS4.png
    Also, I suspect the configuration is not applied on the right endpoint address correctly. I would like to know how do you configure the service on the server-side.
    Feel free to let me know if there is anything I can help with.
    Best Regards
    Abraham
    Tuesday, October 8, 2019 8:06 AM
    Moderator
  • Thanks to reply :)

    Dear Abraham ,

    I have done already above changes during implementation of  the TCP binding. and I checked the endpoint of the service. it is correct. and i what to let you know that  it is working fine on my local system does not give any error related to timeout. it occurs only on the server 2008. whole application is working fine on the server  and giving expected output. in case of report it also works fine but when huge amount of data  filters in the report at that time it shows error  "timeout".

    Please reply As Soon As Possible.

    Wednesday, October 9, 2019 5:14 AM
  • Hi,

    In other words, the server only reports timeout errors when transferring big data, right? Under normal circumstances, even if deployed to the server, the service will run normally.
    First of all, please post the complete error message, I will try to reproduce the problem. Then can you post your full configuration on the server side?
    Feel free to let me know if the problem still exists.
    Best Regards
    Abraham

    Wednesday, October 9, 2019 9:53 AM
    Moderator
  • Dear Abraham,

    Right, it is working in the normal case but in case of huge amount of data is occurred timeout error. 

    Please find below the full details of error. 

    what is mean of full configuration details?

    <?xml version="1.0"?><error statusCode="500" time="2019-09-23T11:55:31.5487837Z" detail="System.Web.HttpException (0x80004005): Request timed out." message="Request timed out." type="System.Web.HttpException" host="NOIORATPP" application="/LM/W3SVC/2/ROOT/Ebix.Evolution/VS19/Web" errorId="6ff99967-d6a8-414d-bf6f-2497ea767437">

    -<serverVariables>
    -<item name="ALL_HTTP">
    <value string="HTTP_CONNECTION:keep-alive HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 HTTP_ACCEPT_ENCODING:gzip, deflate HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.9 HTTP_COOKIE:ASP.NET_SessionId=4tjgko1vf22enigqlg1xctis; __AntiXsrfToken=1bbac4e26cd944beafb4eaffc9e0b96b HTTP_HOST:192.168.93.115 HTTP_REFERER:http://192.168.93.115/Ebix.Evolution/VS19/Web/EMR006/EMR006Rpt.aspx HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 HTTP_UPGRADE_INSECURE_REQUESTS:1 "/>
    </item>
    <item name="ALL_RAW">


    <value string="Connection: keep-alive Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Cookie: ASP.NET_SessionId=4tjgko1vf22enigqlg1xctis; __AntiXsrfToken=1bbac4e26cd944beafb4eaffc9e0b96b Host: 192.168.93.115 Referer: http://192.168.93.115/Ebix.Evolution/VS19/Web/EMR006/EMR006Rpt.aspx User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 Upgrade-Insecure-Requests: 1 "/>
    </item>
    <item name="APPL_MD_PATH">
    <value string="/LM/W3SVC/2/ROOT/Ebix.Evolution/VS19/Web"/>
    </item>
    <item name="APPL_PHYSICAL_PATH">
    <value string="C:\Projects\Ebix.Evolution\VS19\Web\"/>
    </item>


    Wednesday, October 9, 2019 10:46 AM
  • Hi,
    Please post the complete System.servicemodel section in the configuration file(web.config on the server-side).
    From the error details you provided, I only get the point that the server has an http 500 error, which means that the server-side ran into the problem. there might be something wrong with service configuration.
    Feel free to let me know if there is anything I can help with.
    Best Regards
    Abraham
    Thursday, October 10, 2019 6:53 AM
    Moderator
  • Dear Abraham,

    I am only getting Request timed out."  message on the ALM(Exception file ) file. because this error occurs on the server not in local system. only timeout exception and status code 500 . i got 

    I can share the webconig which i deployed on the server.

    please suggest to me required changes.

     <bindings>
          <netTcpBinding>
            <binding name="TCPBinding" portSharingEnabled="true"  maxBufferSize="2147483647" maxBufferPoolSize="2147483647"  transferMode="Buffered"  openTimeout="00:55:00"  receiveTimeout="00:55:00" closeTimeout="00:55:00" sendTimeout="00:55:00" maxReceivedMessageSize="2147483647">
              <!--<reliableSession inactivityTimeout="00:10:00" enabled="true" />-->
             <reliableSession ordered="true" inactivityTimeout="00:55:00" enabled="false" />
       <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              
                  <!-- <security mode="None" />-->
            </binding>             
          </netTcpBinding>
        </bindings>
       <client>
          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/Logon.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.Logon.ILogon" name="TCPBinding_ILogon"/>
          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/Client.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.Client.IClient" name="TCPBinding_IClient"/>

        <client>

    Friday, October 11, 2019 4:52 AM
  • Hi,

    The configuration on the server-side is the main element that caused this problem.
    The client configuration is minor than the configuration on the server-side. Please post the webconfig on the server-side. Only the complete System.servicemode section.
    The key issue is that we need to apply the configuration to the service endpoint.
    Best Regards
    Abraham

    Friday, October 11, 2019 7:04 AM
    Moderator
  • Hi Abraham,

    Please find  below details of web config

    Due to security. i can't share the endpoint of services

     <system.serviceModel>
        <behaviors>
          <endpointBehaviors>
            <behavior name="LotsOfObjects">
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
            <behavior name="ServiceAspNetAjaxBehavior">
              <enableWebScript/>
            </behavior>
            <behavior name="Ebix.Evolution.Presentation.ServiceAspNetAjaxBehavior">
              
              <enableWebScript/>
            </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>      
            <dataContractSerializer maxItemsInObjectGraph="2147483647" />       
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="ServiceBehavior" name="Service">
            <endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Service">
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          <service name="Ebix.Evolution.Presentation.Service">
            <endpoint address="" behaviorConfiguration="Ebix.Evolution.Presentation.ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Ebix.Evolution.Presentation.Service"/>
          </service>
        </services>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <!-- start testing-->
        <bindings>
          <netTcpBinding>
            <binding name="TCPBinding" transactionFlow="false"  hostNameComparisonMode="StrongWildcard" transactionProtocol="OleTransactions"
               portSharingEnabled="true"  maxBufferSize="2147483647" maxBufferPoolSize="2147483647"  transferMode="Buffered"  openTimeout="00:55:00"  receiveTimeout="00:55:00" closeTimeout="00:55:00" sendTimeout="00:55:00" maxReceivedMessageSize="2147483647">
              <!--<reliableSession inactivityTimeout="00:10:00" enabled="true" />-->
             <reliableSession ordered="true" inactivityTimeout="00:55:00" enabled="false" />
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
             <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                <message clientCredentialType="Windows" />
              </security>
            </binding>             
          </netTcpBinding>
        </bindings>


        <client>


          

          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/Setting.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.Setting.ISetting" name="TCPBinding_Setting"/>
          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/CDGINV.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.CDGINV.ICDGINV" name="BTCPBinding_ICDGINV"/>
          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/CLIR01.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.CLIR01.ICLIR01" name="BTCPBinding_CLIR01"/>
       
          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/EMR005_2.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.EMR005_2.IEMR005_2" name="TCPBinding_EMR005_2"/>
             <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/TPB.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.TPB.ITPB" name="TCPBinding_TPB"/>
     
        </client>

      </system.serviceModel>




    Friday, October 11, 2019 9:44 AM
  • Hi,
    It seems there is not a service endpoint created by Nettcpbinding in the configuration. namely, the service is not published over Nettcp protocol. Thereby I suspect whether the connection the client used is using NetTCP service endpoint.

         <service behaviorConfiguration="ServiceBehavior" name="Service">
            <endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Service">
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
          <service name="Ebix.Evolution.Presentation.Service">
            <endpoint address="" behaviorConfiguration="Ebix.Evolution.Presentation.ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Ebix.Evolution.Presentation.Service"/>
          </service>

    All these endpoints are using Http protocol instead of Nettcpbinding although we have configured the Nettcpbinding.

    <bindings>
          <netTcpBinding>
            <binding name="TCPBinding" transactionFlow="false"  hostNameComparisonMode="StrongWildcard" transactionProtocol="OleTransactions"


    The client section in the configuration is invalid on the server-side. Thereby the residual problem is which binding we intend to use. Here is the definition of the Nettcp endpoint.

    <endpoint address="" binding="netTcpBinding" contract="isv"></endpoint>



    Anyway, whichever binding we used we should apply the configuration by using the BindingConfiguration property.

    <service name="sv">
            <endpoint address="" binding="basicHttpBinding" contract="isv" bindingConfiguration="mybinding"></endpoint>
          </service>
       <bindings>
          <basicHttpBinding>
            <binding name="mybinding" maxBufferSize="20000000" maxReceivedMessageSize="2147483647" >
              <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
          </basicHttpBinding>
        </bindings>

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

    Best Regards

    Abraham


    Monday, October 14, 2019 2:19 AM
    Moderator
  • Dear Abraham,

    both kind of binding is working on this project HTTP and Net.TCP.  please find the implementation of tcp.net binging  details.

    please suggest to me. there are something wrong to implement the net.tcp binding.

     <!-- start testing-->
        <bindings>
          <netTcpBinding>
            <binding name="TCPBinding" transactionFlow="false"  hostNameComparisonMode="StrongWildcard" transactionProtocol="OleTransactions"
               portSharingEnabled="true"  maxBufferSize="2147483647" maxBufferPoolSize="2147483647"  transferMode="Buffered"  openTimeout="00:55:00"  receiveTimeout="00:55:00" closeTimeout="00:55:00" sendTimeout="00:55:00" maxReceivedMessageSize="2147483647">
              <!--<reliableSession inactivityTimeout="00:10:00" enabled="true" />-->
             <reliableSession ordered="true" inactivityTimeout="00:55:00" enabled="false" />
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
             <security mode="Transport">
                <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
                <message clientCredentialType="Windows" />
              </security>
            </binding>             
          </netTcpBinding>
        </bindings>


        <client>


          <endpoint address="net.tcp://localhost/Ebix.Evolution.Service/Host/Logon.svc" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="Proxy.Logon.ILogon" name="TCPBinding_ILogon"/>

       <client>

    Monday, October 14, 2019 5:37 AM
  • Hi,
    I don’t think so, from your server-side configuration, there isn’t service endpoint. How could it run over nettcp protocol?
    Can you call the service properly by constructing a client proxy with this client endpoint?
    ServiceReference1.TestServiceClient client = new TestServiceClient("TCPBinding_ILogon");
    //then start an invocation.

    We are able to publish the service over nettcp protocol with the below code segments.
    <services>
          <service name="WcfService3.Service1">
            <endpoint address="myservice" binding="netTcpBinding" contract="WcfService3.IService1" ></endpoint>
    <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"></endpoint>
          </service>
    </services>

    Then we specify an net.tcp base address in the IIS site binding module.
    Best Regards
    Abraham
    Monday, October 14, 2019 8:57 AM
    Moderator