Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I need to connect my application to outlook with EWS service through URL. I have set all the values properly but it throws an error "502-bad-gateway-error-happen". Please help where am I doing wrong. How can I check the connection is established or not?

What I have tried:

string Domain = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;
string Host = System.Net.Dns.GetHostName();
service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
WebProxy proxy = new WebProxy("112.33.22.44", "1234");
proxy.Credentials = new NetworkCredential("user1", "karma123", "mango.com");
service.WebProxy = proxy;
service.EnableScpLookup = true;
service.Credentials = new WebCredentials("user1@mango.com", "karma123", "mango.com");
try
{ 
   service.Url = new Uri("https://YY048199.mango.com/EWS/Exchange.asmx");
}
catch (UriFormatException ex)
{
  return false;
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900