Trying to consume AXL web service (error: (505) Http Version Not Supported)

Version 1
    This document was generated from CDN thread

    Created by: Othman alhukail on 16-11-2013 11:52:25 PM
    Hi all,

    I'm writing a C# code to consume the AXL call mange web services. But I'm getting the follwoing error: "The remote server returned an error: (505) Http Version Not Supported."

    Apreceate your help on this pelase. Thank you in advance.

    Below the code used to call the web service:
     1            System.Net.ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
     2
     3            String sAXLRequest = null; // will hold only the SOAP payload
     4            String sAXLSOAPRequest = null;
     5
     6            // Build the SOAP payload
     7            sAXLRequest = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" ";
     8            sAXLRequest += "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"> ";
     9            sAXLRequest += "<SOAP-ENV:Body> <axl:getPhone xmlns:axl=\"http://www.cisco.com/AXL/1.0\" ";
    10            sAXLRequest += " xsi:schemaLocation=\"http://www.cisco.com/AXL/1.0 http://ccmserver/schema/axlsoap.xsd\" ";
    11            sAXLRequest += "sequence=\"1234\"> <phoneName>axzohammed</phoneName> ";
    12            sAXLRequest += "</axl:getPhone> </SOAP-ENV:Body> </SOAP-ENV:Envelope>";
    13
    14            // finish the HTTPS Header
    15            sAXLSOAPRequest += sAXLRequest.Length;
    16            sAXLSOAPRequest += "\r\n\r\n";
    17
    18            // now add the SOAP payload to the HTTPS header, which completes the AXL SOAP request
    19            sAXLSOAPRequest += sAXLRequest;
    20
    21            // now that the message has been built, we can connect to server and send it
    22            HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("https://<SERVER_IP>:8443/axl");
    23            myReq.Method = "POST";           
    24            myReq.ContentType = "text/xml";           
    25            myReq.Timeout = 30000;           
    26            myReq.Host = "<SERVER_IP>:8443";           
    27            myReq.Headers.Add("POST", "8443/axl");            //myReq.Headers.Add("Host", "10.60.245.6");           
    28            myReq.Headers.Add("Authorization", "Basic bXNwcm9ExWN0Ok4VMTIzNDU2");           
    29            myReq.Accept = ":text/*";            //myReq.Headers.Add("Accept", ":text/*");           
    30            myReq.ContentType = "text/xml";            //myReq.Headers.Add("Content-type", "text/xml");
    31            byte[] PostData = Encoding.UTF8.GetBytes(sAXLRequest);
    32            myReq.ContentLength = PostData.Length;
    33
    34            using (Stream requestStream = myReq.GetRequestStream()){               
    35                    requestStream.Write(PostData, 0, PostData.Length);           
    36            }
    37
    38            HttpWebResponse response = (HttpWebResponse)myReq.GetResponse(); //<< The Error return at this line