예제 #1
0
 public static ZimbraValues GetZimbraValues()
 {
     if (zimbraValues == null)
     {
         zimbraValues = new ZimbraValues();
     }
     return(zimbraValues);
 }
예제 #2
0
 public ZimbraValues()
 {
     zimbraValues   = null;
     sUrl           = "";
     sAuthToken     = "";
     sServerVersion = "";
     lDomains       = new List <string>();
     lCOSes         = new List <CosInfo>();
     lTags          = new List <TagInfo>();
 }
예제 #3
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);
        }
예제 #4
0
 public ZimbraValues()
 {
     zimbraValues = null;
     sUrl = "";
     sAuthToken = "";
     sServerVersion = "";
     lDomains = new List<string>();
     lCOSes = new List<CosInfo>();
     lTags = new List<TagInfo>();
 }
예제 #5
0
 public ZimbraValues()
 {
     zimbraValues     = null;
     sUrl             = "";
     sAuthToken       = "";
     sServerVersion   = "";
     sDefaultCosIndex = -1;
     lDomains         = new List <string>();
     lZimbraDomains   = new List <DomainInfo>();
     lCOSes           = new List <CosInfo>();
 }
예제 #6
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);
            }
        }
예제 #7
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);
        }
예제 #8
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);
            }
        }
예제 #9
0
 public static ZimbraValues GetZimbraValues()
 {
     if (zimbraValues == null)
         zimbraValues = new ZimbraValues();
     return zimbraValues;
 }