4
我正在忙於編寫一些代碼,這些代碼將通過PHPEWS更新Microsoft Exchange服務器上的物理地址;使用PHP EWS更新聯繫人物理地址
但是對於我的生活我無法完全弄清楚如何更新物理地址,我可以更新除此之外的所有其他內容。
這是我的代碼。
// Update Physical Address.
$field = new EWSType_SetItemFieldType();
$field->IndexedFieldURI->FieldURI = 'contacts:PhysicalAddress:Street';
$field->IndexedFieldURI->FieldIndex = EWSType_PhysicalAddressKeyType::HOME;
$field->Contact = new EWSType_ContactItemType();
$field->Contact->PhysicalAddress = new EWSType_PhysicalAddressDictionaryType();
$address = new EWSType_PhysicalAddressDictionaryEntryType();
$address->Key = EWSType_PhysicalAddressKeyType::HOME;
$address->_ = $street;
$field->Contact->PhysicalAddresses->Entry = $address;
$change->Updates->SetItemField[] = $field;
我不斷收到以下錯誤多小時的反覆試驗,我終於算出來後,我自己
Array ([0] => stdClass Object ([MessageText] => An object within a change description must contain one and only one property to modify. [ResponseCode] => ErrorIncorrectUpdatePropertyCount [DescriptiveLinkKey] => 0 [ResponseClass] => Error [Items] => stdClass Object ()))
希望有人能幫助
感謝Philip。自從上個3-4小時以來,我遇到了同樣的問題。你救了我。他們應該在某處顯示您需要逐一放置密鑰來更新它。 –