,microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. null

Viewed 1549
    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();
    }
    }

I am trying to connect to web server by using the above code i am getting the exception as, microsoft.exchange.webservices.data.core.exception.service.remote.ServiceRequestException: The request failed. Connection is still allocated

0 Answers
Related