Exemplo n.º 1
0
        private HttpWebRequest CreateWebRequest()
        {
            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);

            webRequest.ContentType = "application/soap+xml; charset=\"utf-8\"";
            webRequest.UserAgent   = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
            webRequest.Method      = "POST";
            webRequest.Proxy       = null;
            return(webRequest);
        }
Exemplo n.º 2
0
        private HttpWebRequest CreateWebRequest()
        {
            // using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);

                webRequest.ContentType = "application/soap+xml; charset=\"utf-8\"";
                webRequest.UserAgent   = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
                webRequest.Method      = "POST";
                webRequest.Proxy       = null;
                return(webRequest);
            }
        }
Exemplo n.º 3
0
        private HttpWebRequest CreateWebRequestRaw(string authtoken, bool isServerMig)
        {
            CookieContainer cookieContainer = new CookieContainer();
            Cookie          cookie          = (isServerMig) ? new Cookie("ZM_ADMIN_AUTH_TOKEN", authtoken) : new Cookie(
                "ZM_AUTH_TOKEN", authtoken);

            cookieContainer.Add(new Uri(this.Url), cookie);

            HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);

            webRequest.CookieContainer = cookieContainer;
            webRequest.UserAgent       = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
            webRequest.Method          = "POST";
            webRequest.Proxy           = null;
            return(webRequest);
        }
Exemplo n.º 4
0
        private HttpWebRequest CreateWebRequestRaw(string authtoken, bool isServerMig)
        {
            //using (LogBlock logblock = Log.NotTracing() ? null : new LogBlock(GetType() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name))
            {
                // Get a cookie container containing ZM_ADMIN_AUTH_TOKEN or ZM_AUTH_TOKEN
                CookieContainer cookieContainer = new CookieContainer();
                Cookie          cookie          = (isServerMig) ? new Cookie("ZM_ADMIN_AUTH_TOKEN", authtoken) : new Cookie("ZM_AUTH_TOKEN", authtoken);
                cookieContainer.Add(new Uri(this.Url), cookie);

                // Create the webRequest
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(this.Url);
                webRequest.CookieContainer = cookieContainer;
                webRequest.UserAgent       = "ZimbraMigration" + "/" + ZimbraValues.GetZimbraValues().ClientVersion;
                webRequest.Method          = "POST";
                webRequest.Proxy           = null;

                webRequest.Timeout = 10 * 60 * 1000; // 10 mins
                Log.verbose("Connection timeout is", webRequest.Timeout, "ms");

                return(webRequest);
            }
        }