locked
error:the remote server returned an unexpected response 400 bad request. RRS feed

  • Question

  • hi i have this error "the remote server returned an unexpected response 400 bad request." i have google it and foudn that i need to increase the request sizse i did but nothing happend , ( iam trying to send object to a wcf ( if the object has 3 rows its works fine) but 4 and + ther erro appears

    here is mt app.config and wen.config

    App.config

    	<bindings>
      <wsHttpBinding>
      <binding name="WSHttpBinding_IService" closeTimeout="00:01:00"
       openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
       bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
       maxBufferPoolSize="500000000" maxReceivedMessageSize="500000000" messageEncoding="Text"
       textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
       <readerQuotas maxDepth="500000000" maxStringContentLength="500000000" maxArrayLength="500000000"
       maxBytesPerRead="500000000" maxNameTableCharCount="500000000" />
       <reliableSession ordered="true" inactivityTimeout="00:10:00"
       enabled="false" />
       <security mode="Message">
       <transport clientCredentialType="Windows" proxyCredentialType="None"
        realm="" />
       <message clientCredentialType="Windows" negotiateServiceCredential="true"
        algorithmSuite="Default" />
       </security>
      </binding>
      </wsHttpBinding>
     </bindings>
    		<client>
      <endpoint address="http://sami-laptop/AlHayatMedicalC/Service.svc"
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
      contract="AlHayatMC.IService" name="WSHttpBinding_IService" >
    	  
      <identity>
       <dns value="localhost" />
    		
      </identity>
    	 
      </endpoint>
     </client>
    

     

    web.config

    <system.web>
    		<httpRuntime maxRequestLength="524288" />
    
    

     

    can u tell me what is wrong thanx

    Monday, November 29, 2010 1:14 PM

All replies

  • The max length setting has to be modified for your binding (not for http runtime)

     

    eg:-

     

    <services>

          <service name="DataService">

            <endpoint address="http://localhost:2881/DataService.svc"         

             binding="webHttpBinding" bindingConfiguration="higherMessageSize"

             contract ="System.Data.Services.IRequestHandler">

            </endpoint>

          </service>

        </services>

        <bindings>

          <webHttpBinding>

            <binding name="higherMessageSize" maxBufferSize="50000000" maxReceivedMessageSize="50000000" />

          </webHttpBinding>

        </bindings>


    #Bineesh ------------------------------------ Mark best replies as answers please.
    Tuesday, November 30, 2010 4:05 AM