public ObWsRequest(string token, string server, string port, bool ssl, WebProxy proxy, int timeOut, GPSInfos gpsInfos)
 {
     Token  = token;
     Server = server;
     Port   = port;
     Ssl    = ssl;
     Proxy  = proxy;
     Url    = !Ssl
               ? (string.IsNullOrEmpty(port) ? "http://" + Server : "http://" + Server + ":" + Port)
               : (string.IsNullOrEmpty(port) ? "https://" + Server : "https://" + Server + ":" + Port);
     ServicePointManager.ServerCertificateValidationCallback += Utility.ValidateServerCertificate;
     TimeOut  = timeOut;
     GPSInfos = gpsInfos;
 }
        public void connection(string userName, string password, string server, string port, bool ssl, WebProxy proxy, int timeOut, GPSInfos gpsInfos)
        {
            UserName = userName;
            Password = password;
            Server   = server;
            Port     = port;
            Ssl      = ssl;
            Proxy    = proxy;
            AuthInfo = UserName + ":" + Password;
            AuthInfo = Convert.ToBase64String(Encoding.Default.GetBytes(AuthInfo));
            //Url = "http://" + Server + ":" + Port;
            Url = !Ssl
                      ? (string.IsNullOrEmpty(port) ? "http://" + Server : "http://" + Server + ":" + Port)
                      : (string.IsNullOrEmpty(port) ? "https://" + Server : "https://" + Server + ":" + Port);
            ServicePointManager.ServerCertificateValidationCallback += Utility.ValidateServerCertificate;

            TimeOut  = timeOut;
            GPSInfos = gpsInfos;
        }
 public ObWsRequest(string userName, string password, string server, string port, bool ssl, WebProxy proxy, int timeOut, GPSInfos gpsInfos, bool httpWebRequestKeepAlive, bool sendChunked, bool allowWriteStreamBuffering)
 {
     this.connection(userName, password, server, port, ssl, proxy, timeOut, gpsInfos);
     HttpWebRequestKeepAlive   = httpWebRequestKeepAlive;
     SendChunked               = sendChunked;
     AllowWriteStreamBuffering = allowWriteStreamBuffering;
 }
 /// <summary>
 /// Constructor of the object that contains the common parameters of the request
 /// </summary>
 /// <param name="userName">login</param>
 /// <param name="password">password</param>
 /// <param name="server">server name or adress</param>
 /// <param name="port">port</param>
 /// <param name="ssl">true : secured connection | false:non secured connection</param>
 /// <param name="proxy">WebProxy</param>
 /// <seealso cref="System.Net">WebProxy</seealso>
 /// <param name="timeOut">time max of the request</param>
 /// <param name="gpsInfos">GPSInfos</param>
 /// <seealso cref="OpenBeeApi.Common.Request.GPSInfos">GPSInfos</seealso>
 public ObWsRequest(string userName, string password, string server, string port, bool ssl, WebProxy proxy, int timeOut, GPSInfos gpsInfos, bool httpWebRequestKeepAlive)
 {
     this.connection(userName, password, server, port, ssl, proxy, timeOut, gpsInfos);
     HttpWebRequestKeepAlive = httpWebRequestKeepAlive;
 }