큰 xml 파일을 REST 서비스에 업로드하려고합니다 ... Google의 stackoverflow에 지정된 거의 모든 메소드를 시도했지만 아직 위치를 찾을 수 없습니다. ! 잘못되어 가고 .... 내가 지정한WCF REST 서비스에 큰 xml 업로드 -> 400 잘못된 요청
.. 64킬로바이트보다 maxRequestLength의 파일 더 업로드 할 수 없습니다 :
<httpRuntime maxRequestLength="65536"/>
를 다음과 같이 내 바인딩 설정은 다음과 같습니다
<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>
에서 나는 다음과 같은 일을 오전 내 C# 클라이언트 측 : 내가 피들러를 시도
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);
}
클라이언트 측에서 수행 특별한 구성이 없습니다 ...
은 ... 클라이언트는 적절한 요청을 보내는 .. . 그러나 서버는 즉시 400으로 응답합니다.
@marc_s : 나도 같은 생각하지만, 문서 "최대 요청 크기를 KB 단위로 [가]"에 따라되었다. http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx –