Click here to Skip to main content
15,886,823 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,
I have created a WCF service and trying to access the methods in that from the service client application.
Created the Proxy for the service and when sending the Small data XML file(upto 75 kb) its working fine. If we send the data more than that giving the folowing exception.
The remote server returned an unexpected response: (400) Bad Request.
below are ny configuration settings..
the Host web.config file...
HTML
<bindings>
			<basichttpbinding>
				<binding name="basicHttpBinding_IDataAcquisitionService">
				  maxBufferPoolSize="200000000" maxReceivedMessageSize="200000000" maxBufferSize="200000000"&gt;
					<readerquotas maxdepth="200000000" maxstringcontentlength="200000000">
					  maxArrayLength="200000000" maxBytesPerRead="20000000" maxNameTableCharCount="200000000" /&gt;
					<security mode="None">
						<transport clientcredentialtype="None" proxycredentialtype="None">
						  realm="" /&gt;
						<message clientcredentialtype="UserName" algorithmsuite="Default" />
					</transport></security>
				</readerquotas></binding>
			</basichttpbinding>
		</bindings>

the server web.config file...
HTML
<bindings>
      <basichttpbinding>
        <binding name="basicHttpBinding" maxbuffersize="200000000">
          maxBufferPoolSize="200000000" maxReceivedMessageSize="200000000"&gt;
          <readerquotas maxdepth="200000000" maxstringcontentlength="200000000">
            maxArrayLength="200000000" maxBytesPerRead="200000000" maxNameTableCharCount="200000000" /&gt;
          <security mode="None">
            <transport clientcredentialtype="None" proxycredentialtype="None">
              realm="" /&gt;
            <message clientcredentialtype="UserName" algorithmsuite="Default" />
          </transport></security>
        </readerquotas></binding>
      </basichttpbinding>
    </bindings>

the App.config file ...
HTML
<bindings>
            <basichttpbinding>
                <binding name="DataAcquisitionService">
                    maxBufferSize="200000000" maxBufferPoolSize="200000000" maxReceivedMessageSize="200000000"&gt;
                    <readerquotas maxdepth="200000000" maxstringcontentlength="200000000" maxarraylength="200000000">
                        maxBytesPerRead="200000000" maxNameTableCharCount="200000000" /&gt;
                    <security mode="TransportCredentialOnly">
                        <transport clientcredentialtype="Ntlm" proxycredentialtype="None">
                            realm="" /&gt;
                        <message clientcredentialtype="UserName" algorithmsuite="Default" />
                    </transport></security>
                </readerquotas></binding>
            </basichttpbinding>
        </bindings>

I have given Max values for all the bindings but not able to process the Large data files.
Could You please Help me in this regard.
thanks
Chandra
Posted
Updated 4-Jun-12 22:50pm
v2
Comments
Oleksandr Kulchytskyi 5-Jun-12 4:24am    
What about timeouts for sending/receiving data ??
SASS_Shooter 5-Jun-12 10:56am    
The unexpected response is when an exception, thrown by the communication stack, is returned to the client. Can you click on 'Improve Question' and include the exception with the stack trace?
SASS_Shooter 5-Jun-12 10:57am    
Oh yes...almost forgot...open your svc file in the browser and make certain that you are able to actually view your service. If you cannot open your svc file in the browser, you cannot talk to it from your client.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900