Hi
I have a customer with an exchange server (EWS from the customer). I can access this email through Google Chrome, but cannot access in my code. Below is my code snippet. I am creating an ExcahngeWebServiceClient first, which succeeds. However, the GetMailBoxSize() call always give me an "http 440 Timeout" exception. This exception was thrown so fast that I do not think it is a real timeout. can anyone help me on this? Thanks.
Moreover, this email server URL has some extra info so that the user has permission to access the email box but does not own it.
Below is the code.
try
{
using (ExchangeWebServiceClient client = GetExchangeWebServiceClient(config))
{
client.GetMailboxSize();
return ExchangeServerType.EWS;
}
}
catch {
}
private static ExchangeWebServiceClient GetExchangeWebServiceClient(ExchangeClientConfig config)
{
string domain = string.Empty, userName = string.Empty;
Utils.ExtractDomain(config.UserName, ref domain, ref userName);
string serverUrl = config.ServerUrl.StartsWith("https://") ? config.ServerUrl + "/ews/Exchange.asmx" : "https://" + config.ServerUrl + "/ews/Exchange.asmx";
ExchangeWebServiceClient client = new ExchangeWebServiceClient(serverUrl, userName, Encryptor.Decrypt(config.Password), domain);
return client;
}