none
wcf exception: The server did not provide a meaningful reply RRS feed

  • Pregunta

  • I have a service that use the tcp binding and this services allows to the clients interact with the database. I use EF and self tracking entities.

    One thing that I want to do is store files in the database, so to not overload the wire, i have two tables with their corresponding entities. One table Documents with the information of the documents (type, size... etc) and other table, Files, that store the binary information, the file.

    Well, in local, when I run the client and the service in the same computer, I can store the files that I want. I try with a file of 6MB. But If I run the client in other computer in the same lan, then I have many problems.

    For example, if I try to store a small file, 50kB, I don't have problems, but if I try to store the file of 6MB, then I can get different errors.

    For example, if I configure in the client a low timeout, for example 1 minute, I get the error:

    System.TimeoutException: This request operation sent to net.tcp://192.168.1.5:7997/CMMSHost did not receive a reply within the configured timeout (00:01:00).

    If I configure the client to have a timeout of 10 minutes, then I get the following error:

    The server did not provide a meaningful reply

    The service is hosted in a wpf application, and in the Begin method of the serve that add the document in the database, I send a text with a log to know if the call is received or not. When I get some of the errors, the call in not received, so I think that the problem perhaps is that the self tacking entity for some reason does not arrive to the service.

    My app.config for the service is the following:

    <endpoint address=""
                     
    binding="netTcpBinding"
                     
    bindingConfiguration="tcpBinding"
                     
    name="NetTcpBindingEndpoint"
                     
    contract="GTS.CMMS.Service.IService">
             
    <identity>
               
    <dns value="localhost" />
             
    </identity>
           
    </endpoint>

           
    <endpoint contract="IMetadataExchange" binding="mexTcpBinding" address="net.tcp://localhost:5000/mex" />
         
    </service>
       
    </services>

       
    <behaviors>
         
    <serviceBehaviors>
           
    <behavior name="behaviorConfig">
             
    <!--
              <serviceMetadata httpGetEnabled="true" />-->

             
    <!--Necesario para poder enviar excepciones desde el servicio al cliente.-->
             
    <serviceDebug includeExceptionDetailInFaults="true"/>
             
    <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" />
             
    <serviceMetadata/>
           
    </behavior>
         
    </serviceBehaviors>
       
    </behaviors>


       
    <bindings>
         
    <netTcpBinding>
           
    <binding name="tcpBinding" maxBufferSize="67108864"
                         
    maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
                           
    transferMode="Buffered" closeTimeout="00:00:10"
                           
    openTimeout="00:00:10" receiveTimeout="00:20:00"
                           
    sendTimeout="00:01:00" maxConnections="100">
             
    <security mode="None"/>
             
    <readerQuotas maxArrayLength="67108864" maxBytesPerRead="67108864" maxStringContentLength="67108864"/>
             
    <reliableSession enabled="true" inactivityTimeout="00:20:00" />
           
    </binding>
         
    </netTcpBinding>
       
    </bindings>
     
    </system.serviceModel>

    And the client configuration is:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
     
    <system.serviceModel>
       
    <bindings>
         
    <netTcpBinding>
           
    <binding name="NetTcpBinding_IService" closeTimeout="00:01:00"
             
    openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00"
             
    transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
             
    hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
             
    maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">
             
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
               
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
             
    <reliableSession ordered="true" inactivityTimeout="00:20:00"
               
    enabled="true" />
             
    <security mode="None">
               
    <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
               
    <message clientCredentialType="Windows" />
             
    </security>
           
    </binding>
         
    </netTcpBinding>
       
    </bindings>
       
    <client>
         
    <endpoint address="net.tcp://192.168.1.5:7997/CMMSHost" binding="netTcpBinding"
           
    bindingConfiguration="NetTcpBinding_IService" contract="IService"
           
    name="NetTcpBinding_IService" />
       
    </client>
     
    </system.serviceModel>
    </configuration>

    Thanks.

    ComptonAlvaro.

    martes, 26 de junio de 2012 15:05

Respuestas

  • You need to configure the web config the maximum size of the message for po

    der upload larger files.
    I put a section for you to see web.config

    <webHttpBinding> 
            <binding name="StreamedRequestWebBinding"
                     bypassProxyOnLocal="true"
                     useDefaultWebProxy="false"
                     hostNameComparisonMode="WeakWildcard"
                     sendTimeout="10:15:00"
                     openTimeout="10:15:00"
                     receiveTimeout="10:15:00"
                     maxReceivedMessageSize="2147483647"
                     maxBufferSize="2147483647"
                     maxBufferPoolSize="2147483647"
                     transferMode="StreamedRequest">
              <readerQuotas maxArrayLength="2147483647"
                            maxStringContentLength="2147483647" />
            </binding>
     </webHttpBinding>

    Aldo Flores

    http://alduar.blogspot.com.es/


    • Marcado como respuesta ComptonAlvaro jueves, 16 de mayo de 2013 18:25
    domingo, 15 de julio de 2012 9:34