Using AXL in C#

Version 1
    This document was generated from CDN thread

    Created by: Mark Gregorio on 05-03-2009 01:58:46 PM
    I have created an application in an attempt to query data using AXL in C#. When I run the code, I am getting the following error.
    System.Net.WebException: The request failed with HTTP status 505: HTTP Version Not Supported.\r\n.
    I have read that because of an error between .Net and Tomcat that I need to use HTTP 1.0 instead of HTTP 1.1. How do I go about doing this? Below is the code I am running.

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.IO;
    using System.Net;

    namespace CiscoWebApp
    {
        public partial class _Default : System.Web.UI.Page
        {

            protected override void Render(HtmlTextWriter writer)
            {
                using (AXLAPIService myAxl = new AXLAPIService("ip", "username", "password"))
                try
                {
                    CMCInfoReq req = new CMCInfoReq();
                    GetCMCInfoRes res = myAxl.getCMCInfo(req);
                    GetCMCInfoResReturn ret = res.@return;
                    writer.Write(ret.cmcInfo.code);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
    }


    Thanks in advance for any help.
     

    Subject: RE: Using AXL in C#
    Replied by: Jad Houdeib on 19-03-2009 09:22:11 AM
    Hi
    To fix this problem,
    In the proxy class , after this line :
     
     
     
     
     

    <font size="2">
     
    </font>
     
    public partial class AXLAPIService : System.Web.Services.Protocols.
    SoapHttpClientProtocol

     
    Copy this method to use HTTP 1.0
     
    <font size="2">
     
    </font>
     
       protected override System.Net.WebRequest GetWebRequest(Uri uri)
      {
       System.Net.HttpWebRequest request = base.GetWebRequest (uri) as System.Net.HttpWebRequest;
       request.ProtocolVersion = System.Net.HttpVersion.Version10;
       return request;
      }