title: How to validate credentials in EWS Java API
body: <p>I am using EWSJavaAPI 1.1.5. I am trying to login with invalid credentials, but I don't get any exceptions.</p>
  
  <p>Please advise how to detect and handle invalid login.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>String host = "myhost";
  ExchangeService service = null;
  try {
      service = new ExchangeService();
      ExchangeCredentials credentials = new WebCredentials("wrongemail",
          "wrongpass");
      service.setCredentials(credentials);
      service.setUrl(new java.net.URI("https://" + host
          + "/EWS/Exchange.asmx"));
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>