저는 EWS 웹 서비스의 새로운 사용자이고 다른 기능을 처리 할 수 있습니다 (FindItem, FindFolder, getItem 등). 하지만 해결할 수 없습니다. 이 하나 : 모든 최신 수정 또는 일정 폴더에서 약속 만들기를 찾으려고합니다. 첫 번째 아이디어는 LastModificationDate 확장 필드 (PropertyId = 0x3008)에 제한이있는 FindItemType 요청을 작성하고 findItem 메소드를 호출하는 것이 었습니다.EWS - Exchange Web Services 2007에서 마지막으로 수정 한 일정 찾기
나는 다음과 같은 코드를 시도했지만, 결과는 항상 빈 (aorit.Items == NULL)입니다 :
_esb = new ExchangeServiceBinding();
_esb.Url = serviceUrl;
_esb.Credentials = new NetworkCredential
{
UserName = userName,
Password = password,
Domain = domain
};
// snipped...
FindItemType fit = new FindItemType
{
ItemShape = new ItemResponseShapeType
{
BaseShape = DefaultShapeNamesType.IdOnly
},
ParentFolderIds = folderTypes,
Traversal = ItemQueryTraversalType.Shallow,
Restriction = new RestrictionType
{
Item = new IsGreaterThanOrEqualToType
{
FieldURIOrConstant = new FieldURIOrConstantType
{
Item = new ConstantValueType { Value = lastModifiedDateSearched.ToUniversalTime().ToString("u") }
},
Item = new PathToExtendedFieldType
{
DistinguishedPropertySetIdSpecified = true,
DistinguishedPropertySetId = DistinguishedPropertySetType.Appointment,
PropertyType = MapiPropertyTypeType.SystemTime,
PropertyId = 0x3008,
PropertyIdSpecified = true,
}
}
}
};
FindItemResponseType response = _esb.FindItem(fit);
List<ItemIdType> res = new List<ItemIdType>();
foreach (FindItemResponseMessageType firmt in response.ResponseMessages.Items.Where(c => c.IsNotNull()))
{
if (firmt.RootFolder.IsNotNull())
{
ArrayOfRealItemsType aorit = firmt.RootFolder.Item as ArrayOfRealItemsType;
if (aorit != null && aorit.Items.IsNotNull())
{
foreach (ItemType item in aorit.Items)
{
if (item.ItemId.IsNotNull())
{
res.Add(item.ItemId);
}
}
}
}
}
내 쿼리가 올 것 같으면 누군가가 알고 있습니까? 이 작업을 올바르게 수행합니까? 도움을 주셔서 감사합니다.