Pregunta

Estoy usando wshttpbinding para mi servicio

<wsHttpBinding>
            <binding name="wsHttpBinding_Windows" maxBufferPoolSize="9223372036854775807" maxReceivedMessageSize="2147483647">
                <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647"/>
                <security mode="Message">
                    <message clientCredentialType="Windows"/>
                </security>
            </binding>
        </wsHttpBinding>

<behavior name="ServiceBehavior">
                <dataContractSerializer  maxItemsInObjectGraph="6553600"/>
                <serviceThrottling maxConcurrentCalls="2147483647" maxConcurrentInstances="2147483647" maxConcurrentSessions="2147483647"/>
            </behavior>

Y cuando intento subir un archivo de 15 MB, lanza el punto final de punto de punto final a continuación:

Mensaje de excepción:

There was no endpoint listening at "MY SERVICE URL" that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Excepción:

The remote server returned an error: (404) Not Found.
¿Fue útil?

Solución

Hay (2) configuraciones maxRequestLength y maxAllowedContentLength En el lado del servidor, en su confección de WCF, debe aumentar para que esta excepción se resuelva. En el .config para el lado del servidor de servicio WCF, asegúrese de agregar lo siguiente:

<system.web>
  <!--Increase 'maxRequestLength' to needed value: 100mb (value is in kilobytes)-->
  <httpRuntime maxRequestLength="102400"/>
</system.web>

<system.webServer>
  <security>
    <requestFiltering>
      <!--Increase 'maxAllowedContentLength' to needed value: 100mb (value is in bytes)-->
      <requestLimits maxAllowedContentLength="104857600" />
    </requestFiltering>
  </security>
</system.webServer>

Otros consejos

El límite de carga se establece en 2 niveles, primero por la aplicación y el segundo por el servidor.

La configuración de su aplicación me parece bien.

Verifique su configuración de IIS como se define en su archivo Machine.Config. Encontre un Artículo de Microsoft KB Para configurar esto

Puede configurar el valor en cualquiera de estos lugares.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top