This is wrecking my brain for a while now. The code works fine when I post a smaller XML string. As soon as I add more XML nodes and post, I get the infamous '404 Error'
I'm posting XML data as a string to a Generic Handler in C#.
string strXML = "Large XML Content Here";
WebClient client = new WebClient();
string xmlResult = "";
try
{
xmlResult = client.DownloadString(_workContext.AccountingWebServiceLink
+ "?action=updateprimary&xml="
+ System.Web.HttpUtility.UrlEncode(strXML));
}
catch(Exception e)
{
System.IO.File.AppendAllText(Server.MapPath("~/addressXMLReturnError.txt"),
"Error: " + e.Message + " returnValue = " + xmlResult);
}
I think it might have something to do with the server not accepting large strings?