【发布时间】:2015-03-12 23:09:23
【问题描述】:
我正在使用 Exchange 2010 EWS 托管 API 并尝试更新电子邮件 (EmailMessage)。
更新EmailMessage's Sender.Name 属性时,Update() 出现异常,但如果我尝试更新EmailMessage's Subject,它就可以正常工作。
private void UpdateEmail(ItemId itemId)
{
try
{
EmailMessage emailMessage = EmailMessage.Bind(service, itemId, new PropertySet(EmailMessageSchema.Sender, EmailMessageSchema.Subject));
// Test 1 - this works:
emailMessage.Subject = "Testing";
emailMessage.Update(ConflictResolutionMode.AlwaysOverwrite);
// Test 2 - this does NOT work (if I comment out the previous 2 lines btw):
emailMessage.Sender.Name = "John Smith";
emailMessage.Update(ConflictResolutionMode.AlwaysOverwrite); // exception thrown
...
我从测试 2 中得到以下错误:
The request failed schema validation: The element 'Updates' in namespace 'http:/
/schemas.microsoft.com/exchange/services/2006/types' has incomplete content. Lis
t of possible elements expected: 'AppendToItemField, SetItemField, DeleteItemFie
ld' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types'.
【问题讨论】:
标签: c# outlook exchange-server exchangewebservices