0

Java APIを使用してOutlook.comからすべてのカレンダーイベントを取得します。 Java APIを使用してOutlook.comからカレンダーイベントを取得

public void findChildFolders(String username, String password) throws Exception 
    { 
     ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2); 
     ExchangeCredentials credentials = new WebCredentials(username, password); 

//  URI jira_url = URI.create("outlook.live.com"); 
     service.autodiscoverUrl(username, new RedirectionUrlCallback()); 
     service.setCredentials(credentials); 

     FindFoldersResults findResults = service.findFolders(WellKnownFolderName.Inbox, new FolderView(Integer.MAX_VALUE)); 

     for (Folder folder : findResults.getFolders()) 
     { 
      System.out.println("Count======" + folder.getChildFolderCount()); 
      System.out.println("Name=======" + folder.getDisplayName()); 
     } 
    } 

    static class RedirectionUrlCallback implements IAutodiscoverRedirectionUrl 
    { 
     @Override 
     public boolean autodiscoverRedirectionUrlValidationCallback(
      String redirectionUrl) 
     { 
      return redirectionUrl.toLowerCase().startsWith("https://"); 
     } 
    } 

しかし、私は、エラー・スタックを取得::私は接続するには、このコードをテストした

microsoft.exchange.webservices.data.autodiscover.exception.AutodiscoverLocalException: The Autodiscover service couldn't be located. 
    at microsoft.exchange.webservices.data.autodiscover.AutodiscoverService.internalGetLegacyUserSettings(AutodiscoverService.java:742) 

このコードを実装する適切な方法は何ですか?

答えて

0

ルームリソースカレンダーを取得する完全な実例は、Office365 API - Admin accessing another users/room's calendar eventsです。認証された同じユーザーのカレンダーイベント、または認証されたユーザーに権限がある場合は別のユーザー/電子メール/リソースを取得するために、コードを簡単に変更できます。

関連する問題