我試圖使用EWS在Exchange 2010上搜索任務文件夾。我試圖限制返回的任務的到期日期,但不幸的是沒有等同於任務文件夾的CalendarView,所以我必須使用FindItem搜索。在Exchange Web服務中無效的抽象類型FindItem請求
我使用Java,Axis2和我準備了這樣的查詢:
// 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);
不幸的是,我得到這個錯誤:
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.
從法國大致翻譯,這意味着查詢因爲SearchExpression類型是抽象的,或者它的類型是失敗。
搜索後,我發現this文章解釋如何修改types.xsd
文件來處理此問題。但是,即使在應用修改之後,我仍然得到相同的錯誤。
我不知道如何去解決這個問題。任何幫助,將不勝感激。