,microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException:请求失败。空值

时间:2017-07-21 05:35:08

标签: java exchangewebservices

    private static String url ="https://myemail.com/ews/exchange.asmx";
    private static String username="user@email.com";
    private static String password="user@123";
    private static String domain="Dir";
    public class service{
    ExchangeService exchangeService = null;
    exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
    exchangeService.setUrl(new URI(EmailService.url));
    ExchangeCredentials credentials = new WebCredentials(username, password,domain);
    exchangeService.setCredentials(credentials);
    FindItemsResults<Item> results = null;
    try {
        String getFolderId = null;
        Folder rootfolder = 
        Folder.bind(service,WellKnownFolderName.MsgFolderRoot);
        rootfolder.load();
    }
    }

我正在尝试使用上面的代码连接到Web服务器我得到例外,因为,  microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException:请求失败。仍然分配了连接

0 个答案:

没有答案