none
我想通過EWS來讀寫web outlook app 的行事歷數據。 RRS feed

  • 問題

  • 想通過EWS來讀寫web outlook app 的行事歷數據。 程式如下。   

             System.Net.ServicePointManager.ServerCertificateValidationCallback =
                delegate(Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
                {
                    // Replace this line with code to validate server certificate.
                    //Console.WriteLine("error ::: Replace this line with code to validate server certificate.");
                    return true;
                };
                // Create the bindings and set the credentials.
                ExchangeServiceBinding esb = new ExchangeServiceBinding();
                esb.Url = "https://Ex10.bill.local/EWS/exchange.asmx";
                esb.Credentials = new NetworkCredential("Administrator", "Ewqazxc2008", "EX10.bill.local");

                CalendarItemType appointment = new CalendarItemType();
                appointment.Body = new BodyType();
                appointment.Body.BodyType1 = BodyTypeType.Text;
                appointment.Body.Value = "test";
                appointment.Importance = ImportanceChoicesType.High;
                appointment.ImportanceSpecified = true;
                appointment.ItemClass = "IPM.Appointment";
                appointment.Subject = "Danny Subject";
                appointment.Start = DateTime.Now.AddHours(2);
                appointment.StartSpecified = true;
                appointment.End = DateTime.Now.AddHours(3);
                appointment.EndSpecified = true;

                CreateItemType request = new CreateItemType();
               
                request.SendMeetingInvitations = CalendarItemCreateOrDeleteOperationType.SendToAllAndSaveCopy;
                request.SendMeetingInvitationsSpecified = true;
                request.SavedItemFolderId = new TargetFolderIdType
                    {
                        Item = new DistinguishedFolderIdType
                        {
                            Id = DistinguishedFolderIdNameType.calendar
                        }
                    };
                request.Items = new NonEmptyArrayOfAllItemsType { Items = new ItemType[] { appointment } };

                CreateItemResponseType response = esb.CreateItem(request);

    在這里出現錯誤的信息。這樣的錯誤信息。

    請問高手這是什么原因? 謝謝!

    2012年6月26日 上午 10:12

解答

所有回覆