These are chat archives for OfficeDev/ews-java-api

Nov 2018
Nov 19 2018 13:18
Hello thanks, after join declaration and assignment for 'inbox' variable and adding trace code , i got this:
Type: EwsRequestHttpHeaders
Message: <Trace Tag="EwsRequestHttpHeaders" Tid="16" Time="2018-11-19 13:15:20Z">
POST /ews/Exchange.asmx HTTP/1.1
Keep-Alive : 300
Content-type : text/xml; charset=utf-8
Accept : text/xml
User-Agent : ExchangeServicesClient/
Connection : Keep-Alive
Accept-Encoding : gzip,deflate


Type: EwsRequest
Message: <Trace Tag="EwsRequest" Tid="16" Time="2018-11-19 13:15:20Z">
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="" xmlns:xsi="" xmlns:m="" xmlns:t=""><soap:Header><t:RequestServerVersion Version="Exchange2010_SP2"></t:RequestServerVersion></soap:Header><soap:Body><m:GetFolder><m:FolderShape><t:BaseShape>AllProperties</t:BaseShape></m:FolderShape><m:FolderIds><t:DistinguishedFolderId Id="inbox"></t:DistinguishedFolderId></m:FolderIds></m:GetFolder></soap:Body></soap:Envelope>

13:15:21.153 [http-nio-8080-exec-1] WARN  c.o.s.e.a.s.EwsService - Error occured The request failed. The request failed. Certificate for <> doesn't match any of the subject alternative names: [,,]
and my test service
public String testService() {
        try {
            ExchangeCredentials credentials = new WebCredentials("*********@***********.com", "********!");
            this.service.setUrl(new URI("https://********************.com/ews/Exchange.asmx"));
            this.service.setTraceListener(new ITraceListener() {
                public void trace(String type, String message) {
                    System.out.println("Type: " + type + "\nMessage: " + message);

            Folder inbox = Folder.bind(this.service, WellKnownFolderName.Inbox);
            return new StringBuilder("INBOX (").append(inbox.getTotalCount()).append(")").toString();

        } catch (Exception e) {
            this.getLogger().warn("Error occured ", e);
        return "error";
Pavel Kropachev
Nov 19 2018 20:51
EWS SOAP request is correct.
Looks like that hostname which you use to connect to EWS is not included to certificate of your Exchange server. In the result, verification of this hostname is failed.
You can use one of the subject alternative names from certificate to connect, e.g. "", "".
Or use custom service (with non-default hostname verifier) to ignore verification of hostname (in fact, allow all hosts).