I am new to EPP and web servers etc and i am getting this issue: The server committed a protocol violation. Section=ResponseStatusLine.

I am trying to send xml through. Would it be possible to help me.

My code is:

        System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);

        string myUrl = "https://www.companyURL:portNumber";

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(myUrl));
        request.Method = "POST";
        request.ContentType = "application/xml";
        request.Accept = "application/xml";
        request.KeepAlive = false;

        //XDocument.Load(requestXml);

        byte[] bytes = Encoding.UTF8.GetBytes(requestXml.ToString());

        request.ContentLength = bytes.Length;

        using (Stream putStream = request.GetRequestStream())
        {
            putStream.Write(bytes, 0, bytes.Length);
        }

        // Log the response from Redmine RESTful service
        using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) //It breaks here
        using (StreamReader reader = new StreamReader(response.GetResponseStream()))
        {
            Logger.Info("Response from Redmine Issue Tracker: " + reader.ReadToEnd());
        }

I have added this in to my web config: httpWebRequest useUnsafeHeaderParsing="true"

it is breaking here: using (StreamReader reader = new StreamReader(response.GetResponseStream()))

Related posts

Recent Viewed