CreateItem 操作(任务)
CreateItem 操作在 Exchange 存储区中创建任务项。
任务 CreateItem 请求
说明
下面的 CreateItem 请求示例演示如何在邮箱中创建任务项。
代码
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Body>
<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
MessageDisposition="SaveOnly">
<Items>
<t:Task>
<t:Subject>My task</t:Subject>
<t:DueDate>2006-10-26T21:32:52</t:DueDate>
<t:Status>NotStarted</t:Status>
</t:Task>
</Items>
</CreateItem>
</soap:Body>
</soap:Envelope>
Comments
当运行安装了客户端访问服务器角色的 Microsoft Exchange Server 2007 的计算机收到定期任务的请求时,将更改这些请求。 会发生以下更改:
仅保存任务重复周期范围的 StartDate (Recurrence) 属性的日期。 时间部分将被截断。
可以根据重复周期模式调整 StartDate (Recurrence) 属性。 例如,如果将重复周期模式指定为每个星期一,并且 StartDate 设置为 2006 年 10 月 26 日(即星期四),则 StartDate 将调整为 2006 年 10 月 30 日,即下一个星期一。
如果设置了任务的 StartDate 属性,则会将其更新为匹配 定期范围的 StartDate (Recurrence) 。 任务的 DueDate 属性也会根据新的 StartDate 进行更新。
如果未设置 StartDate ,则仅更新 DueDate 属性以匹配 定期范围的 StartDate (Recurrence) 。
下表显示了客户端访问服务器对具有每个星期一的 Task.Recurrence.Pattern 的定期任务所做的更改。
对定期任务的更改
属性 | 原始值 | 更新的值 |
---|---|---|
Task.StartDate |
2006 年 1 月 1 日 |
2006 年 10 月 30 日 |
Task.DueDate |
2006 年 1 月 3 日 |
2006 年 11 月 1 日 |
Task.Recurrence.Range.StartDate |
2006 年 10 月 26 日 |
2006 年 10 月 30 日 |
默认情况下,如果未指定目标文件夹,则会在“任务”文件夹中创建任务项。
请求元素
请求中使用以下元素:
成功的任务 CreateItem 响应
说明
以下示例显示了对 CreateItem 请求的成功响应。
代码
<?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:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="653" MinorBuildNumber="0"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"/>
</soap:Header>
<soap:Body>
<CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ResponseMessages>
<m:CreateItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Task>
<t:ItemId Id="AAAtAE=" ChangeKey="EwAAABYA"/>
</t:Task>
</m:Items>
</m:CreateItemResponseMessage>
</m:ResponseMessages>
</CreateItemResponse>
</soap:Body>
</soap:Envelope>
成功的响应元素
响应中包含以下元素: