I am trying to upload large xml files to the REST service ... I have tried almost all the methods specified in stackoverflow in google, but I still can not find out where I am wrong .... I can not upload a file more than 64 kb !. .
I pointed out maxRequestLength:
<httpRuntime maxRequestLength="65536"/>
and my binding configuration is as follows:
<bindings>
<webHttpBinding>
<binding name="RESTBinding" maxBufferSize="67108864" maxReceivedMessageSize="67108864" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
In my C # client side, I do the following:
WebRequest request = HttpWebRequest.Create(@"http://localhost.:2381/RepositoryServices.svc/deviceprofile/AddDdxml");
request.Credentials = new NetworkCredential("blah", "blah");
request.Method = "POST";
request.ContentType = "application/xml";
request.ContentLength = byteArray.LongLength;
using (Stream postStream = request.GetRequestStream())
{
postStream.Write(byteArray, 0, byteArray.Length);
}
There is no special configuration on the client side ...
I tried a violinist ... The client sends the correct request ... But the server immediately responds 400.
source
share