[英]EWS Exchange Web service API AutodiscoverUrl exception
I get an error when I try to create an appointment: 我尝试创建约会时收到错误:
The expected XML node type was XmlDeclaration, but the actual type is Element. 预期的XML节点类型是XmlDeclaration,但实际类型是Element。
This Exception occurs when I call AutodiscoverUrl
. 当我调用AutodiscoverUrl
时会发生此异常。
I created a web service to do this. 我创建了一个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);
}
Some potential answers. 一些潜在的答案。
Autodiscover depends on two things: 自动发现取决于两件事:
DNS entries that point from the users mail domain to the Autodiscover data on the Exchange server. 从用户邮件域指向Exchange服务器上的自动发现数据的DNS条目。 Typically you would have a DNS entry with the name autodiscover.domain.com, but there's more than one way of setting this up for different versions of Exchange. 通常,您将拥有一个名为autodiscover.domain.com的DNS条目,但是有不止一种方法可以为不同版本的Exchange设置此条目。 If the correct DNS entry doesn't exist, auto-discovery will fail. 如果不存在正确的DNS条目,则自动发现将失败。
Autodiscover data hosted on the Exchange server (I believe it's an XML file) and accessed over HTTP. 托管在Exchange服务器上的自动发现数据(我相信它是一个XML文件)并通过HTTP访问。 If this isn't accessible (perhaps it's behind a firewall) then auto-discovery will fail. 如果无法访问(可能它位于防火墙后面),则自动发现将失败。
Check the appropriate DNS entries and autodiscover information is accessible to your client. 检查适当的DNS条目,并且客户端可以访问自动发现信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.