I'm having some trouble dealing with the (in)famous exception "The server commited a protocol violation", I'm trying to send a XML string to a given ip address-port and everything seems to be tip-top but this nasty exception is getting on my nerves, I read some fixes like the config file but that did not work, I'm no expert in C# so I guess there is some gruesome error lingering here somewhere, any help would be appreciated!
string xml = "<Login services=\"NetPage\"/>\n" +
"<PageRequest pager=\"2;22\" system_id=\"18\"/>";
string url = new UriBuilder("http", ipAddress, 3700).ToString();
using (System.Net.WebClient client = new System.Net.WebClient())
{
try
{
client.UploadString(url, xml);
}
catch(WebException ex)
{
throw ex;
}
}