尝试删除联系人物理地址会导致 ErrorSchemaValidation 响应

Trying to Delete a Contact PhysicalAddress results in ErrorSchemaValidation Response

尝试从联系人中删除整个地址时,出现 "The request failed schema validation" 错误。我的请求看起来像这样

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/types"
                   xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/messages">
    <SOAP-ENV:Header>
        <ns1:RequestServerVersion Version="Exchange2010"/>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns2:UpdateItem ConflictResolution="AlwaysOverwrite" MessageDisposition="SaveOnly">
            <ns2:ItemChanges>
                <ns1:ItemChange>
                    <ns1:ItemId
                        Id="..."
                        ChangeKey=".."/>
                    <ns1:Updates>
                        <ns1:DeleteItemField>
                            <ns1:IndexedFieldURI FieldURI="contacts:PhysicalAddress" FieldIndex="Business"/>
                        </ns1:DeleteItemField>
                    </ns1:Updates>
                </ns1:ItemChange>
            </ns2:ItemChanges>
        </ns2:UpdateItem>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

这是我的回复

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
    <s:Fault>
        <faultcode xmlns:a="http://schemas.microsoft.com/exchange/services/2006/types">a:ErrorSchemaValidation
        </faultcode>
        <faultstring xml:lang="en-US">The request failed schema validation: The 'FieldURI' attribute is invalid - The
            value 'contacts:PhysicalAddress' is invalid according to its datatype
            'http://schemas.microsoft.com/exchange/services/2006/types:DictionaryURIType' - The Enumeration constraint
            failed.
        </faultstring>
        <detail>
            <e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorSchemaValidation
            </e:ResponseCode>
            <e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request failed schema
                validation.
            </e:Message>
            <t:MessageXml xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
                <t:LineNumber>2</t:LineNumber>
                <t:LinePosition>717</t:LinePosition>
                <t:Violation>The 'FieldURI' attribute is invalid - The value 'contacts:PhysicalAddress' is invalid
                    according to its datatype
                    'http://schemas.microsoft.com/exchange/services/2006/types:DictionaryURIType' - The Enumeration
                    constraint failed.
                </t:Violation>
            </t:MessageXml>
        </detail>
    </s:Fault>
</s:Body>
</s:Envelope>

试图删除合同的公司地址。然而,问题是没有 contacts:PhysicalAddress DictionaryFieldURI,地址的每个字段只有 DictionaryFieldURI。同样,我不能只传递 contacts:PhysicallAddresses 字段 URI,因为它没有索引,所以我无法指定要用它删除的 which 地址。

那么我的请求应该是什么样子,只是删除联系人的公司实际地址?

它们的物理地址是一组属性,无法按照您尝试的方式删除,您需要遍历每个单独的属性(例如城市、地址等)并删除您想要的使空。例如

<?xml version="1.0" encoding="utf-8"?>
<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" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2013_SP1" />
  </soap:Header>
  <soap:Body>
    <m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
      <m:ItemChanges>
        <t:ItemChange>
          <t:ItemId Id="AAMkADczNDE4YWEwLTdlZLrCDQAAE1MmZPAAA=" ChangeKey="EQAAABYAAAB1EEf9GOowTZ1AsUKLrCDQAAE1Vhdy" />
          <t:Updates>
            <t:DeleteItemField>
              <t:IndexedFieldURI FieldURI="contacts:PhysicalAddress:City" FieldIndex="Business" />
            </t:DeleteItemField>
          </t:Updates>
        </t:ItemChange>
      </m:ItemChanges>
    </m:UpdateItem>
  </soap:Body>
</soap:Envelope>

干杯 格伦