Hi Developers,
In my Application when i try to send more than 2232199 length string from asp.net mvc application to Webservice i got the following error.
The remote server returned an error: (500) Internal Server Error.
C# Code
lstrRequestXml = Request string with 2232199 length.
lstrReturnXml = Postman.SendService("CUSTOMER_REQUEST", lstrRequestXml);
Error got the following line :
try
{
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
if (!string.IsNullOrEmpty(result))
{
XDocument doc = XDocument.Parse(result);
result = doc.Root.Value;
}
sr.Close();
}
glblGeneral.Log_Handler("SendService(POST)", string.Format("Url :- {0}, Request :- {1}, Response :- {2}", url, requestData, result), 1);
}
Added in Web.config
If anyone know how to fix this error kindly suggest me
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="21474836481" />
</requestFiltering>
</security>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<httpRuntime maxRequestLength="2097152123" />
</system.web>