简体   繁体   English

EWS托管API 2.0 ID格式错误

[英]EWS Managed API 2.0 Id is malformed

I am using EWS Managed API 2.0 to send the meeting invitation and capture the user response. 我正在使用EWS Managed API 2.0发送会议邀请并捕获用户响应。

I have followed the reference from official website https://msdn.microsoft.com/en-us/library/office/jj220499(v=exchg.80).aspx and https://msdn.microsoft.com/en-us/library/office/dd633661(v=exchg.80).aspx . 我遵循了官方网站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 I, am getting an error as Id is malformed. 我,由于ID格式错误,出现错误。

I have used the exact code in the official website. 我在官方网站上使用了确切的代码。 I did some googling and found that if id has special character this error may appear. 我进行了一些谷歌搜索,发现如果id具有特殊字符,则可能会出现此错误。 But the id I provided has no special character its just a simple character. 但是我提供的ID没有特殊字符,只是一个简单字符。

Here is the code 这是代码

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());
            }

Getting an error in Appointment appointment = Appointment.Bind(service, "AAMkA="); Appointment appointment = Appointment.Bind(service, "AAMkA=");遇到错误Appointment appointment = Appointment.Bind(service, "AAMkA="); The id is malfunction. ID是故障。

id为故障

Exchange server will provide a unique Id on creating the appointment. Exchange服务器将在创建约会时提供唯一的ID。 So need to save the Id and pass the same Id when fetching the user response. 因此,需要在获取用户响应时保存ID并传递相同的ID。

var Id = appointment.Id;

So pass the Id to fetch in the response. 因此,传递ID来获取响应。

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

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