I want to add a new appointment in my Exchange server 2013 by using Java and Exchange Web Services Api 2.0.
But I always have this exception :
Exception in thread "main" microsoft.exchange.webservices.data.ServiceRequestException: The request failed. The request failed. hostname in certificate didn't match: <10.0.6.4> != ms-ex
Here is a part of My code :
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("userName", "password");
service.setCredentials(credentials);
service.setUrl(new URI("https:// server address/ews/exchange.asmx"));
Appointment appointment = new Appointment(service);
appointment.setSubject("Appointment subject");
.
.
.
appointment.save();