Exchange server 使用Java EWS 1.2在Exchange中更改约会颜色

Exchange server 使用Java EWS 1.2在Exchange中更改约会颜色,exchange-server,exchangewebservices,appointment,ewsjavaapi,Exchange Server,Exchangewebservices,Appointment,Ewsjavaapi,我正在使用这段代码来设置颜色。信息技术s在我的电脑上设置颜色,但当我向其他人发送约会时,在他们接受后,颜色不会在他们的日历中设置 ExtendedPropertyDefinition propDefColor = new ExtendedPropertyDefinition( UUID.fromString("00062002-0000-0000-c000-000000000046"), 0x8214, MapiPropertyType.Integer); appointment.set

我正在使用这段代码来设置颜色。信息技术s在我的电脑上设置颜色,但当我向其他人发送约会时,在他们接受后,颜色不会在他们的日历中设置

ExtendedPropertyDefinition propDefColor = new ExtendedPropertyDefinition(
  UUID.fromString("00062002-0000-0000-c000-000000000046"),
  0x8214, MapiPropertyType.Integer);
appointment.setExtendedProperty(propDefColor, "6");
在用这段代码保存约会后,我试图检索它,但没有成功

PropertySet propset=new PropertySet(BasePropertySet.FirstClassProperties, propDefColor);
appointment.bind(service,appointment.getId(), propset);
for(ExtendedProperty extendedProperty : appointment.getExtendedProperties()) {
  System.out.println(extendedProperty.getValue());
}
我正在使用:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
满足客户要求。和JavaEWS API1.2

请让我知道如何获得其他客户的颜色。(我不知道如何使用
MasterCategorylist
或categories或
tryGetProperty()

请在这方面帮助我。如果我们需要使用
tryGetProperty()
,那么如何在其中传递参数

  • 属性定义
    在此处输入代码
  • OutParam

  • 请帮忙。

    不会“一路”回答您,但这可能会进一步帮助您。
    我硬编码EWS XML请求,以下是检索主配置列表的方式:

    <soap:Envelope xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"
                   xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
                   xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <typ:RequestServerVersion Version="Exchange2010" />
      </soap:Header>
      <soap:Body>
        <mes:GetUserConfiguration>
          <mes:UserConfigurationName Name="CategoryList">
            <typ:DistinguishedFolderId Id="calendar"/>
          </mes:UserConfigurationName>
          <mes:UserConfigurationProperties>All</mes:UserConfigurationProperties>
        </mes:GetUserConfiguration>
      </soap:Body>
    </soap:Envelope>
    

    这里有分类和相关的颜色。

    没有“一路”回答您,但这可能会进一步帮助您。
    我硬编码EWS XML请求,以下是检索主配置列表的方式:

    <soap:Envelope xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"
                   xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
                   xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <typ:RequestServerVersion Version="Exchange2010" />
      </soap:Header>
      <soap:Body>
        <mes:GetUserConfiguration>
          <mes:UserConfigurationName Name="CategoryList">
            <typ:DistinguishedFolderId Id="calendar"/>
          </mes:UserConfigurationName>
          <mes:UserConfigurationProperties>All</mes:UserConfigurationProperties>
        </mes:GetUserConfiguration>
      </soap:Body>
    </soap:Envelope>
    

    这里有类别和相关颜色。

    我使用另一个代码重新编辑代码,使之更容易。它负责获取/设置所有字段。

    我使用另一个字段重新编辑了代码,使之更容易。它负责获取/设置所有字段。

    请注意,答案应该是搜索解决方案的终点(而不是另一个参考的中途停留,它往往会随着时间的推移变得过时)。请考虑在这里添加一个独立的概要,将链接作为参考。请注意,答案应该是搜索解决方案的终点(而不是另一个引用的停留时间,它会随着时间的推移而变得陈旧)。请考虑在这里添加一个独立的概要,将链接作为参考。您是否找到了如何使用OutPARAM来使用TryGigPrimeType()?u是否找到了如何使用TyGigPrimeType()与OutParam?
    <?xml version="1.0"?>
      <categories default="Red Category" lastSavedSession="2" lastSavedTime="2013-07-29T07:47:43.0411241Z" xmlns="CategoryList.xsd">
      <category name="Red Category" color="0" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="1601-01-01T00:00:00Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2010-09-29T10:08:46.487Z" lastSessionUsed="0" guid="{61c23d24-ed86-47ec-8565-433e3a6b21b7}" renameOnFirstUse="1" />
      <category name="Blue Category" color="7" keyboardShortcut="0" usageCount="6" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="2013-04-17T09:10:04.043Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2013-04-17T09:10:04.043Z" lastSessionUsed="2" guid="{e19dd512-bff1-46d8-a858-54cc114872ad}" renameOnFirstUse="0" />
      <category name="Purple Category" color="8" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="1601-01-01T00:00:00Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2010-09-29T10:08:46.487Z" lastSessionUsed="0" guid="{fd3afb30-285e-4bf2-885e-f9fdfe00002e}" renameOnFirstUse="1" />
      <category name="Green Category" color="4" keyboardShortcut="0" usageCount="6" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="2013-04-17T09:10:12.782Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2013-04-17T09:10:12.782Z" lastSessionUsed="2" guid="{c3dc51d0-1cc4-42cf-9fa9-75146905771f}" renameOnFirstUse="0" />
      <category name="Orange Category" color="1" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="1601-01-01T00:00:00Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2010-09-29T10:08:46.487Z" lastSessionUsed="0" guid="{10c78b6f-5828-4b3c-af0c-138aaac52dae}" renameOnFirstUse="1" />
      <category name="Yellow Category" color="3" keyboardShortcut="0" usageCount="2" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="1601-01-01T00:00:00Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2010-09-29T10:08:46.487Z" lastSessionUsed="0" guid="{37cc21d3-b6a9-4dae-a1fb-422249b9fbb0}" renameOnFirstUse="1" />
      <category name="TimeTell" color="7" keyboardShortcut="0" usageCount="7" lastTimeUsedNotes="1601-01-01T00:00:00Z" lastTimeUsedJournal="1601-01-01T00:00:00Z" lastTimeUsedContacts="1601-01-01T00:00:00Z" lastTimeUsedTasks="1601-01-01T00:00:00Z" lastTimeUsedCalendar="2013-07-29T07:31:17.8034765Z" lastTimeUsedMail="1601-01-01T00:00:00Z" lastTimeUsed="2013-07-29T07:31:17.8034765Z" lastSessionUsed="2" guid="{3348e50b-1763-42fb-a9e9-25b74038b9aa}" renameOnFirstUse="0" />
    </categories>