title: The remote server returned an error: (407) Proxy Authentication Required error in outlook 365 service
body: <p>I am using the below Microsoft exchange service url to call the mailbox in my asp.net (4.5) C# application.</p>
  
  <p><a href="https://outlook.office365.com/EWS/Exchange.asmx" rel="nofollow noreferrer">https://outlook.office365.com/EWS/Exchange.asmx</a></p>
  
  <p>The service and and its invocation is working fine while running from Visual Studio 2012.</p>
  
  <p>But while hosting into IIS, I am getting the below error while service method invocation.</p>
  
  <blockquote>
    <p>The remote server returned an error: (407) Proxy Authentication Required</p>
  </blockquote>
  
  <p>I am using the below code to invoke service:</p>
  
  <pre><code>   ExchangeService service = new 
     ExchangeService(ExchangeVersion.Exchange2010_SP1);
     service.Credentials = new WebCredentials("praveen.vr@abc.com", "pwd", "dom");
     service.UseDefaultCredentials = true;           
     Microsoft.Exchange.WebServices.Data.Folder rootFolder = 
     Microsoft.Exchange.WebServices.Data.Folder.Bind(service, 
     WellKnownFolderName.MsgFolderRoot);
     rootFolder.Load();
  </code></pre>