繁体   English   中英

EWS托管API 2.0 ID格式错误

[英]EWS Managed API 2.0 Id is malformed

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

我遵循了官方网站https://msdn.microsoft.com/zh-cn/library/office/jj220499(v=exchg.80).aspxhttps://msdn.microsoft.com/zh-CN的参考/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());
            }

Appointment appointment = Appointment.Bind(service, "AAMkA=");遇到错误Appointment appointment = Appointment.Bind(service, "AAMkA="); ID是故障。

id为故障

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

var Id = appointment.Id;

因此,传递ID来获取响应。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM