3

FindItem 呼び出しを使用して、Exchange Web サービス (EWS) からアイテム (予定) を取得しています。取得されるプロパティは、アイテム ID と有効な権利です。多くの場合、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>TARGETUSER@SMTP.ADDRESS</t:EmailAddress>
                    </t:Mailbox>
                </t:DistinguishedFolderId>
            </m:ParentFolderIds>
        </m:FindItem>
    </soap:Body>
</soap:Envelope>

「誤った」応答の痕跡:

<?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>

多少関連していると思われるこのブログ投稿を既に見つけましたが、それ以上のものはありません。

4

1 に答える 1

2

FindItems は、アイテム自体からではなく、フォルダーのコンテンツ テーブルから値を読み込みます。多くの場合、EffectiveRights のような計算されたプロパティでは、単純なアプローチを使用してテーブルにデータを入力し、概算を提供します。それがここで起こっていることのようです。コード内のコメントは、アイテムにバインドした後、値が正しいことを示しています (これにより、アイテム自体から値が読み込まれます)。

于 2015-01-29T13:59:58.420 に答える