电子战。更新项目。为什么ChangeKey不改变?
EWS. UpdateItem. Why doesn't ChangeKey change?
在 EWS 中 ItemId
标签有 ChangeKey
属性。这是 Exchange 文档对此属性的描述:
When you work with items in Exchange, another value to keep in mind is the ChangeKey attribute. This value, in addition to the item ID, is used to keep track of the state of an item. Any time an item is changed, a new change key is generated.
所以在我的应用程序中,我正在执行 UpdateItem
操作。这是我发送到服务器的 XML:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<m:UpdateItem xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite" SendMeetingInvitationsOrCancellations="SendToNone">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEMAAAcJDq8WkSCQ77jdOtyazgnAACOg4SZAAA=" ChangeKey="`CQAAAA==`" />
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="message:IsRead" />
<t:Message>
<t:IsRead>false</t:IsRead>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope>
请注意 ChangeKey
是 CQAAAA==
。这是我收到的回复:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="0" MajorBuildNumber="1365" MinorBuildNumber="1" Version="V2_23" />
</s:Header>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:UpdateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:UpdateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEMAAAcJDq8WkSCQ77jdOtyazgnAACOg4SZAAA=" ChangeKey="CQAAAA==" />
</t:Message>
</m:Items>
<m:ConflictResults>
<t:Count>0</t:Count>
</m:ConflictResults>
</m:UpdateItemResponseMessage>
</m:ResponseMessages>
</m:UpdateItemResponse>
</s:Body>
</s:Envelope>
如您所见,返回的更改密钥仍然是 CQAAAA==
。怎么没变?
Read/unread 状态在技术上不是消息本身的一部分;它是单独存储的。这就是在 PF 存储中实现每个用户消息状态的方式。文件夹。
如果您修改任何其他 属性,更改键将更改。
在 EWS 中 ItemId
标签有 ChangeKey
属性。这是 Exchange 文档对此属性的描述:
When you work with items in Exchange, another value to keep in mind is the ChangeKey attribute. This value, in addition to the item ID, is used to keep track of the state of an item. Any time an item is changed, a new change key is generated.
所以在我的应用程序中,我正在执行 UpdateItem
操作。这是我发送到服务器的 XML:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<m:UpdateItem xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite" SendMeetingInvitationsOrCancellations="SendToNone">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEMAAAcJDq8WkSCQ77jdOtyazgnAACOg4SZAAA=" ChangeKey="`CQAAAA==`" />
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI="message:IsRead" />
<t:Message>
<t:IsRead>false</t:IsRead>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope>
请注意 ChangeKey
是 CQAAAA==
。这是我收到的回复:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="0" MajorBuildNumber="1365" MinorBuildNumber="1" Version="V2_23" />
</s:Header>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:UpdateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<m:ResponseMessages>
<m:UpdateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEMAAAcJDq8WkSCQ77jdOtyazgnAACOg4SZAAA=" ChangeKey="CQAAAA==" />
</t:Message>
</m:Items>
<m:ConflictResults>
<t:Count>0</t:Count>
</m:ConflictResults>
</m:UpdateItemResponseMessage>
</m:ResponseMessages>
</m:UpdateItemResponse>
</s:Body>
</s:Envelope>
如您所见,返回的更改密钥仍然是 CQAAAA==
。怎么没变?
Read/unread 状态在技术上不是消息本身的一部分;它是单独存储的。这就是在 PF 存储中实现每个用户消息状态的方式。文件夹。
如果您修改任何其他 属性,更改键将更改。