gpt4 book ai didi

c# - EWS Exchange Web 服务 API AutodiscoverUrl 异常

转载 作者:太空狗 更新时间:2023-10-29 18:00:10 25 4
gpt4 key购买 nike

我在尝试创建约会时遇到错误:

The expected XML node type was XmlDeclaration, but the actual type is Element.

当我调用 AutodiscoverUrl 时发生此异常。
我创建了一个 Web 服务来执行此操作。

[webMethod]
CreateAppointment()
{
var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1)
{
Credentials = new WebCredentials("myAcount@gmail.com", "mypassowrd")
};

service.AutodiscoverUrl("myAcount@gmail.com");

//----------------------------------------------------------------------
var app = new Appointment(service)
{
Subject = "Meet George",
Body = "You need to meet George",
Location = "1st Floor Boardroom",
Start = DateTime.Now.AddHours(2),
End = DateTime.Now.AddHours(3),
IsReminderSet = true,
ReminderMinutesBeforeStart = 15
};
app.RequiredAttendees.Add(new Attendee("any@gmail.com"));
app.Save(SendInvitationsMode.SendToAllAndSaveCopy);
}

最佳答案

一些可能的答案。

  1. 传递了错误的 url 或域。
  2. 传递了错误的电子邮件地址。
  3. 重建 Windows 配置文件有时会有所帮助。 (警告:让 IT 管理员执行此操作)。这可能有点矫枉过正。
  4. 用户可能设置了旧的、不良的或多个 outlook 配置文件。 Outlook 配置文件中的电子邮件服务器名称可能有误。 (请参阅控制面板 > 邮件)

关于c# - EWS Exchange Web 服务 API AutodiscoverUrl 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18954818/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com