ews-java-api icon indicating copy to clipboard operation
ews-java-api copied to clipboard

Contact.getNotes() always return null

Open moimael opened this issue 12 years ago • 5 comments

Hi,

I'm using ews-java-api to get some contact details. I can get everything I need except for notes. No matter what I write in the note field, the api return me a null string.

I test it with Exchange 2010 OWA.

Thanks !

moimael avatar Nov 28 '14 15:11 moimael

Could you attach a trace listener to the ExchangeService and see if the notes are in the XML returned from the Exchange Server?

jimdunkerton avatar Nov 28 '14 15:11 jimdunkerton

I activated the trace listener but I can't find how to use it, even by looking at the code...

moimael avatar Nov 28 '14 16:11 moimael

Something like the following:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1, TimeZone.getTimeZone("UTC"));
service.setTraceEnabled(true);
service.setTraceListener(new ITraceListener() {                 
    @Override
    public void trace(String traceType, String traceMessage) {
        System.out.println(traceMessage);                       
    }
});

jimdunkerton avatar Nov 28 '14 16:11 jimdunkerton

Ok testing with trace listener showed me that note content was returned but in the body. So using contact.getBody() did the trick. So what is contact.getNotes() purpose ?

moimael avatar Nov 28 '14 16:11 moimael

I'm afraid I'm not sure. Sounds like the server is serializing a contact's notes into the wrong XML field.

jimdunkerton avatar Nov 28 '14 16:11 jimdunkerton