I am working on wcf application in which I want upload and download large files in local network. but I got failed exception as "400 bad request".
this is server side config file as below
<configuration>
<system.servicemodel>
<services>
<service behaviorconfiguration="TransferServiceBehavior" name="WcfTransferTest.transfer">
<endpoint address="transfer" binding="basicHttpBinding" bindingconfiguration="TransferService">
contract="WcfTransferTest.Itransfer" />
<host>
<baseAddresses>
<add baseaddress="http://localhost:8001/" />
</baseAddresses>
</host>
</endpoint></service>
</services>
<bindings>
<basichttpbinding>
<binding name="TransferService" maxbuffersize="2147483647" maxreceivedmessagesize="2147483647">
messageEncoding="Text" transferMode="Streamed">
<readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647">
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</readerquotas></binding>
</basichttpbinding>
</bindings>
<behaviors>
<servicebehaviors>
<behavior name="TransferServiceBehavior">
<servicemetadata httpgetenabled="true" />
<datacontractserializer maxitemsinobjectgraph="2147483647" />
<servicedebug includeexceptiondetailinfaults="true" />
<servicethrottling>
maxConcurrentCalls="500"
maxConcurrentSessions="500"
maxConcurrentInstances="500"/>
</servicethrottling></behavior>
</servicebehaviors>
</behaviors>
<servicehostingenvironment multiplesitebindingsenabled="false" />
</system.servicemodel>
<system.webserver>
<modules runallmanagedmodulesforallrequests="true" />
</system.webserver>
<system.web>
<compilation debug="true" /></system.web></configuration>
this is client side config file as below
<configuration>
<system.servicemodel>
<behaviors />
<bindings>
<basichttpbinding>
<binding name="BasicHttpBinding_Itransfer" closetimeout="04:01:00">
openTimeout="04:01:00" receiveTimeout="04:10:00" sendTimeout="04:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Streamed"
useDefaultWebProxy="true">
<readerquotas maxdepth="128" maxstringcontentlength="2147483647">
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None">
<transport clientcredentialtype="None" proxycredentialtype="None">
realm="" />
<message clientcredentialtype="UserName" algorithmsuite="Default" />
</transport></security>
</readerquotas></binding>
</basichttpbinding>
</bindings>
<client>
<endpoint address="http://localhost:3778/transfer.svc/transfer">
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Itransfer"
contract="FileService.Itransfer" name="BasicHttpBinding_Itransfer" />
</endpoint></client>
</system.servicemodel>
</configuration>
when I set client side transferMode to buffered it can upload small file like KB, and show error when file more than 1MB . but it does not make sense , because I set transferMode to Streamed on server side, and client should be same.
when client and service both set to streamed , I receive "bad request 400" . it took my two day and I tried many suggestions , people said it works for them , but mine is not.
in my code chunk Size is 65000.
please tell me concrete answer , like which parameter in config file is got wrong.
could anyone tell me how to fix this error? I tried many solution, maybe I am missing something here.
how can fix that in order to upload large file through basicHttpBinding with Streamed mode?
thanks in advance!