none
The remote server returned an error: (400) Bad Request RRS feed

  • Pregunta

  • I am implementing a WCF Service, I call it from windows aplication  when the aplication sent small quantities of data it works fine but when the aplication sent arger quantities of data gets this error.


    El servidor remoto devolvió una respuesta inesperada: (400) Bad Request.


    Can anyone propose a solution to this problem?
     
    Thank you
     
    My WCF web.config looks as follows :
     
    ========================================================

     


    <system.serviceModel>

       
        <serviceHostingEnvironment aspNetCompatibilityEnabled="false" />
       
        <services>
          <service behaviorConfiguration="ServiceBehavior" name="MyS">

            <endpoint address=""
                      binding="wsHttpBinding"
                      bindingConfiguration="Binding1"
                      name="wsHttpEndpoint"
                      contract="IService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
           
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
           
          </service>
        </services>


        <bindings>
          <wsHttpBinding>
            <binding name="Binding1"
                     maxBufferPoolSize="2147483647"
                     maxReceivedMessageSize="2147483647"
                     closeTimeout="00:10:00"
                     openTimeout="00:10:00"
                     receiveTimeout="00:10:00"
                     sendTimeout="00:10:00"
                     bypassProxyOnLocal="false"
                     transactionFlow="false"
                     hostNameComparisonMode="StrongWildcard"
                     messageEncoding="Text"
                     textEncoding="utf-8"
                     useDefaultWebProxy="true"
                     allowCookies="false"
                     >
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="Message">
                <message clientCredentialType="UserName" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
        <behaviors>

          <endpointBehaviors>
            <behavior>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </endpointBehaviors>
         
          <serviceBehaviors>
            <behavior name="ServiceBehavior">
              <serviceCredentials>
                <serviceCertificate findValue="ECOM" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
                <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="CustomValidator.CustomUserNameValidator, MyS" />
              </serviceCredentials>
              <serviceMetadata httpGetEnabled="true"/>
             
              <serviceDebug includeExceptionDetailInFaults="true" />
             
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
             
            </behavior>

            <!--<behavior name="">
              <serviceCredentials>
                <serviceCertificate findValue="ECOM" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
                <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="CustomValidator.CustomUserNameValidator,MyS" />
              </serviceCredentials>
              <serviceMetadata httpGetEnabled="true"/>

              <serviceDebug includeExceptionDetailInFaults="true" />

              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            </behavior>-->
            <behavior>
              <serviceMetadata httpGetEnabled="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
           
          </serviceBehaviors>
        </behaviors>
        <!--<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>-->
      </system.serviceModel>

     


    My WCF app.config looks as follows :
     
    ========================================================

     

    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
            <binding name="VerificacionDatosSoap" closeTimeout="00:01:00"
              openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
            <binding name="BasicHttpBinding_IService1" closeTimeout="00:10:00"
              openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
              allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://127.0.0.1:81/Service.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
            contract="PARTSService.IService" name="BasicHttpBinding_IService" />
          <endpoint address="http://127.0.0.1:81/service.asmx"
            binding="basicHttpBinding" bindingConfiguration="VerificacionDatosSoap"
            contract="AlestraService.VerificacionDatosSoap" name="VerificacionDatosSoap" />
          <endpoint address="http://127.0.0.1:81/Service.svc" behaviorConfiguration=""
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
            contract="LocalPARTSservice.IService" name="BasicHttpBinding_IService1" />
        </client>
        <behaviors>
          <endpointBehaviors>
            <behavior name="customBehavior">
              <clientCredentials>
                <clientCertificate findValue="Maquina_Cliente" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />
                <serviceCertificate>
                  <authentication certificateValidationMode="ChainTrust" revocationMode="NoCheck" />
                </serviceCertificate>
              </clientCredentials>
              <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
            </behavior>
          </endpointBehaviors>
        </behaviors>
      </system.serviceModel>

    jueves, 26 de enero de 2012 23:42

Todas las respuestas

  • ¡Hola!

    Prueba a realizar una traza al servidor para que te arroje más información sobre el problema.

    La manera más sencilla de de realizar esto es siguiendo los pasos que se citan en la siguiente entrada del blog de Nestor:

    http://silverideas.wordpress.com/2011/07/20/dime-wcf-por-qu-no-funcionas-not-found/

    Saludos,

    miércoles, 12 de septiembre de 2012 10:06