I'm trying to use EWS to search a Task folder on Exchange 2010. I'm trying to limit the due dates of the Tasks returned, but unfortunately there's no equivalent to the CalendarView for the Task folder, so I have to use a FindItem search.
I'm using Java, Axis2 and I prepare the query like this:
// fiType is, obviously, a FindItemType
RestrictionType rType = fiType.addNewRestriction();
IsGreaterThanOrEqualToType igtoretType = IsGreaterThanOrEqualToType.Factory.newInstance();
igtoretType.addNewFieldURI().setFieldURI(UnindexedFieldURIType.TASK_DUE_DATE);
igtoretType.addNewFieldURIOrConstant().addNewConstant().setValue(dateFormat.format(begCal.getTime()));
IsLessThanOrEqualToType iltoretType = IsLessThanOrEqualToType.Factory.newInstance();
iltoretType.addNewFieldURI().setFieldURI(UnindexedFieldURIType.TASK_DUE_DATE);
iltoretType.addNewFieldURIOrConstant().addNewConstant().setValue(dateFormat.format(endCal.getTime()));
SearchExpressionType[] seArr = new SearchExpressionType[2];
seArr[0] = igtoretType;
seArr[1] = iltoretType;
AndType aType = rType.addNewAnd();
aType.setSearchExpressionArray(seArr);
Unfortunately, I get this error:
org.apache.axis2.AxisFault: La demande a échoué lors de la validation du schéma : L'élément 'http://schemas.microsoft.com/exchange/services/2006/types:SearchExpression' est abstrait ou son type l'est.
Roughly translated from French, it means that the query failed because the type SearchExpression is abstract, or it's type is.
After searching, I found this article explaining how to modify the types.xsd
file to take care of this. However, even after applying the modifications, I still get the same error.
I'm at a loss as to how to go about solving this. Any help would be appreciated.