Im using Web Client UploadString to send an Xml as a string to another server created by me. When invoking the UploadString I get a (500-Internal server Error). Im debugging the service that is supposably throwing the exception but I never get there! (there is also a log to prove it). Im using web client in the following way:
using(WebClient webclient = new WebClient())
{
webclient.Encoding = UTF8Encoding.UTF8;
webclient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
webclient.UseDefaultCredentials = true;
webclient.UploadString(url, stringToUpload);
}
I know the following facts:
- stringToUpload.Length=4379663.
- If I send string.Empty I do get to the service Im trying to upload the string to.
Is there a limitation to the size of the string Im sending? If so, What should I do to enable this send or is there another way to handle this situation? Furthermore, Why does the server throws 500 if it realy isn't an internal server error?
Thanks