/// <summary>
        /// Connect with default communication values and no security. 
        /// </summary>
        /// <param name="address">Address of the server</param>
        /// <param name="connectRef">Returns reference id of the new connection</param>
        /// <returns>Returns status/error code</returns>
        public int ConnectEx(string address, out string connectRef)
        {
            int status = (int)EwsStatus.OK;

            // Set security to anonymous
            com.EwsSecurity security= new com.EwsSecurity()
            {
                AuthenticationScheme = AuthenticationSchemes.Anonymous,
                Password = null,
                Username =  null
            };

            // Call main connect method
            status = ConnectEx(address, security, out connectRef);

            return status;
        }
        /// <summary>
        /// Connect to StruxureWare Enterprise server 
        /// </summary>
        private void connectToServer()
        {
            try
            {
                // reference server
                string addr = ExperimentConstants.ip_address;
                Console.WriteLine("Connecting to server " + addr);

                // Set security to Digest
                com.EwsSecurity security = new com.EwsSecurity()
                {
                    AuthenticationScheme = AuthenticationSchemes.Digest,
                    Password = "******",
                    Username = "******"

                };

                // Set default values for connection
                com.EwsBindingConfig config = new com.EwsBindingConfig()
                {
                    MessageVersion = MessageVersion.Soap12,
                    AllowCookies = true,
                    AuthenticationScheme = AuthenticationSchemes.Digest,

                    MaxBufferPoolSize = 1000000,
                    MaxBufferSize = 1000000,
                    MaxReceivedMessageSize = 1000000,

                    OpenTimeout = 30,
                    ReceiveTimeout = 30,
                    SendTimeout = 30,
                    CloseTimeout = 30
                };

                Console.WriteLine("Connect to {0}:", addr);
                // connect to EWS server

                int status = _clientCom.ConnectEx(addr, security, config, out connectRef);

            }
            catch (Exception ex)
            {

                ReportException(ex);
            }
        }