Getting Meeting by ICalUid in EWS

百般思念 提交于 2019-12-24 15:51:55

问题


I'm trying to send a bare bones SOAP request to my Exchange 2010 SP2 server, in order to find a meeting by ICalUid, inspired by this great answer by Glen.

'<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="Exchange2010_SP2"/>' +
'  </soap:Header>' +
'  <soap:Body>' +
'    <m:FindItem Traversal="Shallow">' +
'      <m:ItemShape>' +
'        <t:BaseShape>AllProperties</t:BaseShape>' +
'      </m:ItemShape>' +
'      <m:Restriction>' +
'        <t:IsEqualTo>' +
'          <t:ExtendedFieldURI DistinguishedPropertySetId="Meeting" PropertyId="0x03" PropertyType="Binary"/>' +
'          <t:FieldURIOrConstant>' +
'            <t:Constant Value="bbkpr55lqbc49acfg9objhg40g" />' +
'          </t:FieldURIOrConstant>' +
'        </t:IsEqualTo>' +
'      </m:Restriction>' +
'      <m:ParentFolderIds>' +
'        <t:DistinguishedFolderId Id="calendar" />' +
'      </m:ParentFolderIds>' +
'    </m:FindItem>'
'  </soap:Body>' +
'</soap:Envelope>';

This gives rise to the following error:

The 'PropertyId' attribute is invalid - The value '0x03' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema:int' - The string '0x03' is not a valid Int32 value.

It is obviously not an Int32 value, but why is not the PropertyType="Binary" having any effect?


回答1:


Just use 3 instead of 0x03 in your request XML. The PropertyId in the request itself is defined as an int, and the XML definition doesn't allow hex encoding of int types.



来源:https://stackoverflow.com/questions/33692302/getting-meeting-by-icaluid-in-ews

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!