Open kervin521 opened 8 years ago
microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: No mailbox with such guid. at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278) at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267) at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:165) at microsoft.exchange.webservices.data.core.ExchangeService.internalBindToItems(ExchangeService.java:1343) at microsoft.exchange.webservices.data.core.ExchangeService.bindToItem(ExchangeService.java:1378) at microsoft.exchange.webservices.data.core.ExchangeService.bindToItem(ExchangeService.java:1395) at microsoft.exchange.webservices.data.core.service.item.Appointment.bind(Appointment.java:118) at microsoft.exchange.webservices.data.core.service.item.Appointment.bind(Appointment.java:133)
code when calendarId= "greatwall@waferxa.onmicrosoft.com";
Hi All, i've the same problem. It's strange beacuse if i try to create an appointment, it works without problem. When i try to read the appointment...it show me the same errore above us :/
Any suggestions?
Tnx
microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids. at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278) at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267) at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:165) at microsoft.exchange.webservices.data.core.ExchangeService.findItems(ExchangeService.java:985) at microsoft.exchange.webservices.data.core.ExchangeService.findAppointments(ExchangeService.java:1264) at microsoft.exchange.webservices.data.core.ExchangeService.findAppointments(ExchangeService.java:1285)
code follow : url = "https://outlook.office365.com/EWS/Exchange.asmx"; account = "xxxxxx@waferxa.onmicrosoft.com"; password = "xxxxxxx"; calendarId= "greatwall@waferxa.onmicrosoft.com";
ExchangeCredentials credentials = new WebCredentials(account, password); ExchangeService service = new ExchangeService(); service.setCredentials(credentials); service.setTraceEnabled(true); service.setUrl(new URI(url));//手动 service.setPreAuthenticate(true); service.setTimeout(10_60_1000); if(!StringUtils.isBlank(email)){ service.setImpersonatedUserId(new ImpersonatedUserId(ConnectingIdType.SmtpAddress, calendarId)); }
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date startDate = formatter.parse("2014-07-15 00:00:00"); Date endDate = formatter.parse("2016-07-15 00:00:00"); CalendarView view = new CalendarView(startDate, endDate); FindItemsResults appointments = service.findAppointments(WellKnownFolderName.Calendar, view);