使用 ews-javascript-api 更新交流会议时出错

Error updating an exchange meeting using the ews-javascript-api

我正在使用 ews-javascript-api 更新约会(会议)作为交换。我收到一条错误消息:

请求模式验证失败:\'SuppressReadReceipts\' 属性未声明。

我无法在说明如何执行此操作的文档中找到任何内容。

我上网查了一下,没找到任何有用的东西。

    async updateExchangeItem(_json: any): Promise<any>{
        EwsLogging.DebugLogEnabled = false;
        service.ImpersonatedUserId = new ews.ImpersonatedUserId(ews.ConnectingIdType.SmtpAddress, "myconferenceroom@me.com");
        var id = 'abcdefg';
        var mailbox = new Mailbox("myconferenceroom@me.com");
        var primaryCal = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, mailbox), new PropertySet());

        var meeting = await Appointment.Bind(service, new ItemId(id), ).then((response) =>{
            if (response) {
                response.Subject = 'my subject';
                response.Start = new ews.DateTime('08/28/2019 8:00 am');
                response.End = new ews.DateTime('08/28/2019 9:00 am');

                response.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToAllAndSaveCopy).then(response =>{
                    console.log("worked");
                    return("worked");
                }).catch((error) => {
                    console.log(error);
                });
            }
        });
        return("done");
    }

完整的错误信息如下:

SoapFaultDetails {
  message: 'The request failed schema validation.',
  InnerException: null,
  faultCode: 'a:ErrorSchemaValidation',
  faultString:
   { 'xml:lang': 'en-US',
     faultstring:
      'The request failed schema validation: The \'SuppressReadReceipts\' attribute is not declared.' },
  faultActor: null,
  responseCode: 355,
  errorCode: 0,
  exceptionType: null,
  lineNumber: 1,
  positionWithinLine: 541,
  errorDetails:
   DictionaryWithStringKey {
     keys: [ 'Violation' ],
     keysToObjs: { Violation: 'Violation' },
     objects:
      { Violation: 'The \'SuppressReadReceipts\' attribute is not declared.' },
     keyPicker: [Function] },
  HttpStatusCode: 500 }

它看起来像是源代码中的错误,例如看看

https://github.com/gautamsi/ews-javascript-api/blob/master/src/js/Core/Requests/UpdateItemRequest.ts

特别是

    if (hasValue(this.SuppressReadReceipts)) {
        writer.WriteAttributeValue(XmlAttributeNames.SuppressReadReceipts, true);
    }

这是一个可选值,仅在更新项目时有效,默认情况下为 false。如果您查看原始来源 https://github.com/OfficeDev/ews-managed-api/blob/master/Core/Requests/UpdateItemRequest.cs 。您应该做的是在检查是否存在一个值后,仅在该值为真时才设置该属性(这是原始值),而不是在有任何值为真时设置该属性。