2015-01-28 1 views
3

FindItem 호출을 사용하여 Exchange Web Services (EWS)에서 항목 (약속)을 가져옵니다. 가져온 속성은 항목 ID와 EffectiveRights입니다. EffectiveRights 속성에는 올바른 값이 포함되지 않는 경우가 많습니다. 그러나 때로는 값이 정확하며 (동일한 코드 사용), 원인을 알지 못합니다.EWS FindItem 호출이 잘못된 EffectiveRights 값을 반환합니다.

내가 검색하는 일정 폴더는 내가 인증 한 서비스 사용자에게 작성자 권한으로 위임되며이 서비스 사용자가 작성한 약속이 포함되어 있습니다.

나는 ews-java-api 라이브러리를 사용하고 있으며 응답 추적은 이것이 구문 분석 버그가 아님을 보여줍니다.

항목을 검색하는 데 사용되는 코드 :

ItemView view = new ItemView(100); 
PropertySet propertySet = new PropertySet(); 
propertySet.add(ItemSchema.Id); 
propertySet.add(ItemSchema.EffectiveRights); 
view.setPropertySet(propertySet); 

FolderId folderId = new FolderId(WellKnownFolderName.Calendar, Mailbox.getMailboxFromString(targetSmtpAddress)); 
FindItemsResults<Item> items = service.findItems(folderId, filter, view); 

Item firstItem = items.getItems().get(0); 
firstItem.getEffectiveRights(); // Returns NONE, READ. This is incorrect. 

Item bindItem = Item.bind(service, firstItem.getId()); // 
bindItem.getEffectiveRights(); // Returns NONE, READ, MODIFY, DELETE. This is correct. 

요청 추적 :

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
    <soap:Header> 
     <t:RequestServerVersion Version="Exchange2010_SP2"></t:RequestServerVersion> 
    </soap:Header> 
    <soap:Body> 
     <m:FindItem Traversal="Shallow"> 
      <m:ItemShape> 
       <t:BaseShape>IdOnly</t:BaseShape> 
       <t:AdditionalProperties> 
        <t:FieldURI FieldURI="item:ItemId"></t:FieldURI> 
        <t:FieldURI FieldURI="item:EffectiveRights"></t:FieldURI> 
       </t:AdditionalProperties> 
      </m:ItemShape> 
      <m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning"></m:IndexedPageItemView> 
      <m:Restriction> 
       <t:And> 
        <t:IsEqualTo> 
         <t:ExtendedFieldURI PropertySetId="039b4d91-2f03-44da-887c-aad704243ba8" PropertyName="SyncId" PropertyType="String"></t:ExtendedFieldURI> 
         <t:FieldURIOrConstant> 
          <t:Constant Value="syncID:330"></t:Constant> 
         </t:FieldURIOrConstant> 
        </t:IsEqualTo> 
        <t:IsGreaterThanOrEqualTo> 
         <t:FieldURI FieldURI="calendar:Start"></t:FieldURI> 
         <t:FieldURIOrConstant> 
          <t:Constant Value="2015-01-28T13:53:38Z"></t:Constant> 
         </t:FieldURIOrConstant> 
        </t:IsGreaterThanOrEqualTo> 
       </t:And> 
      </m:Restriction> 
      <m:ParentFolderIds> 
       <t:DistinguishedFolderId Id="calendar"> 
        <t:Mailbox> 
         <t:EmailAddress>[email protected]</t:EmailAddress> 
        </t:Mailbox> 
       </t:DistinguishedFolderId> 
      </m:ParentFolderIds> 
     </m:FindItem> 
    </soap:Body> 
</soap:Envelope> 

는 '결함'응답의 추적 : 이미 this blog post을 발견

<?xml version="1.0" encoding="utf-8"?> 
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> 
    <s:Header> 
     <h:ServerVersionInfo MajorVersion="14" MinorVersion="3" MajorBuildNumber="224" MinorBuildNumber="2" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/> 
    </s:Header> 
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
     <m:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"> 
      <m:ResponseMessages> 
       <m:FindItemResponseMessage ResponseClass="Success"> 
        <m:ResponseCode>NoError</m:ResponseCode> 
        <m:RootFolder IndexedPagingOffset="1000" TotalItemsInView="1868" IncludesLastItemInRange="false"> 
         <t:Items> 
          <t:CalendarItem> 
           <t:ItemId Id="AAMkAGVlZmVlY2JjLTcxOTItNDBkYi1hOTljLTkwZjQwZjE4MTU1NQBGAAAAAADZ8IosQv76QbxS0r8FeFzgBwB25IsPmJcKTaP6zvCUqaybAAAAoIe5AAB25IsPmJcKTaP6zvCUqaybAABcSsgnAAA=" ChangeKey="DwAAABYAAAB25IsPmJcKTaP6zvCUqaybAABcS6ER"/> 
           <t:EffectiveRights> 
            <t:CreateAssociated>false</t:CreateAssociated> 
            <t:CreateContents>false</t:CreateContents> 
            <t:CreateHierarchy>false</t:CreateHierarchy> 
            <t:Delete>false</t:Delete> 
            <t:Modify>false</t:Modify> 
            <t:Read>true</t:Read> 
            <t:ViewPrivateItems>false</t:ViewPrivateItems> 
           </t:EffectiveRights> 
          </t:CalendarItem> 
          <t:CalendarItem> 
           <t:ItemId Id="AAMkAGVlZmVlY2JjLTcxOTItNDBkYi1hOTljLTkwZjQwZjE4MTU1NQBGAAAAAADZ8IosQv76QbxS0r8FeFzgBwB25IsPmJcKTaP6zvCUqaybAAAAoIe5AAB25IsPmJcKTaP6zvCUqaybAABcSsglAAA=" ChangeKey="DwAAABYAAAB25IsPmJcKTaP6zvCUqaybAABcS6EN"/> 
           <t:EffectiveRights> 
            <t:CreateAssociated>false</t:CreateAssociated> 
            <t:CreateContents>false</t:CreateContents> 
            <t:CreateHierarchy>false</t:CreateHierarchy> 
            <t:Delete>false</t:Delete> 
            <t:Modify>false</t:Modify> 
            <t:Read>true</t:Read> 
            <t:ViewPrivateItems>false</t:ViewPrivateItems> 
           </t:EffectiveRights> 
          </t:CalendarItem> 

          <!-- MORE ITEMS HERE... --> 

         </t:Items> 
        </m:RootFolder> 
       </m:FindItemResponseMessage> 
      </m:ResponseMessages> 
     </m:FindItemResponse> 
    </s:Body> 
</s:Envelope> 

다소 관련이있는 것 같지만 그 이상은 아닙니다.

답변

2

FindItems는 항목 자체가 아니라 폴더의 내용 표에서 값을로드합니다. EffectiveRights와 같은 계산 된 속성을 사용하여 여러 번 간단한 접근 방식을 사용하여 테이블을 채우기 위해 근사값을 제공합니다. 그게 여기서 일어나는 것 같아. 코드의 주석은 항목에 바인딩 한 후 (항목 자체에서 값을로드하는) 값이 올바른 것으로 언급합니다.

+0

나는 그것이 내가 바라는 대답이 아니지만, 적어도 나는 지금 설명이있다. – P44T