【问题标题】:EWS Managed API 2.0 Id is malformedEWS 托管 API 2.0 Id 格式不正确
【发布时间】:2018-07-04 06:02:02
【问题描述】:

我正在使用 EWS Managed API 2.0 发送会议邀请并捕获用户响应。

我已经关注了官网https://msdn.microsoft.com/en-us/library/office/jj220499(v=exchg.80).aspx的参考 和https://msdn.microsoft.com/en-us/library/office/dd633661(v=exchg.80).aspx。我收到一个错误,因为 Id 格式错误。

我已经使用了官方网站上的确切代码。我做了一些谷歌搜索,发现如果 id 具有特殊字符,则可能会出现此错误。但是我提供的 id 没有特殊字符,它只是一个简单的字符。

这里是代码

ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
            service.Credentials = new WebCredentials("********@live.com", "************");

            service.TraceEnabled = true;
            service.TraceFlags = TraceFlags.All;

            service.AutodiscoverUrl("***********@live.com", RedirectionUrlValidationCallback);

            // Create the appointment.

            Appointment appointment = Appointment.Bind(service, "AAMkA=");


            // Set properties on the appointment. Add two required attendees and one optional attendee.
            appointment.Subject = "Status Meeting";
            appointment.Body = "The purpose of this meeting is to discuss status.";
            appointment.Start = new DateTime(2009, 3, 1, 9, 0, 0);
            appointment.End = appointment.Start.AddHours(2);
            appointment.Location = "Conf Room";
            appointment.RequiredAttendees.Add("***********@live.com");

            // Send the meeting request to all attendees and save a copy in the Sent Items folder.
            appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

            foreach (Attendee t in appointment.RequiredAttendees)
            {
                if (t.ResponseType != null)
                    Console.WriteLine("Required attendee - " + t.Address + ": " + t.ResponseType.Value.ToString());
            }

@987654326 中出现错误@ID 出现故障。

【问题讨论】:

    标签: c# asp.net asp.net-mvc exchange-server exchangewebservices


    【解决方案1】:

    Exchange 服务器将在创建约会时提供唯一 ID。 所以在获取用户响应时需要保存Id并传递相同的Id。

    var Id = appointment.Id;
    

    所以传递 Id 以在响应中获取。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多