Asp.net 交换Web服务

Asp.net 交换Web服务,asp.net,exchangewebservices,Asp.net,Exchangewebservices,这是通过ExchangeWebServices和asp.net发送约会的应用程序的最后一部分,我对此感到非常困惑 这两个错误取决于我使用的代码段:因此,如果我使用: service.AutodiscoverUrl("Admin@test.com"); 我收到错误:“该帐户没有模拟请求用户的权限” 如果我使用 service.Url = new Uri("https://test.com/OWA/Exchange.asmx") 我收到错误“请求失败。远程服务器返回错误:(440)

这是通过ExchangeWebServices和asp.net发送约会的应用程序的最后一部分,我对此感到非常困惑

这两个错误取决于我使用的代码段:因此,如果我使用:

   service.AutodiscoverUrl("Admin@test.com");
我收到错误:
“该帐户没有模拟请求用户的权限”

如果我使用

    service.Url = new Uri("https://test.com/OWA/Exchange.asmx")
我收到错误“请求失败。
远程服务器返回错误:(440)登录超时。

我可以使用该帐户在web outlook上很好地登录,这样我就知道它是有效的,并且在使用System.NEt.mail时,我还可以从应用程序接收电子邮件

                 public static void SendOutLookAppointment(string email)
    {

        ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);
       // //service.UseDefaultCredentials = true;
        service.Credentials = new WebCredentials("Admin@test.com"", "password");

        //service.AutodiscoverUrl("Admin@test.com");

        service.Url = new Uri("https://webmail.test.com/EWS/Exchange.asmx");

        //service.Credentials = new WebCredentials("Admin@test.com"", "password");
        //service.AutodiscoverUrl("Admin@test.com", RedirectionUrlValidationCallback);

        ImpersonatedUserId i = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "project.management@za.man-mn.com");
        service.ImpersonatedUserId = i;

        Appointment appointment = new Appointment(service);
        appointment.Subject = "Calendar booking via WebService";
        appointment.Body = "This is a test";
        appointment.Start = new DateTime(2014,02,03, 21, 0, 0);
        appointment.End = new DateTime(2014,02,02,22,0, 0);

        appointment.RequiredAttendees.Add(email);


         appointment.Save();
    }

阅读此..可能有帮助嗨,我已经阅读了文章和表单身份验证已被禁用。您需要向我们展示更多的代码,以便我们可以看到您正在尝试执行的操作。你正在尝试访问其他人的邮箱吗?我已在“评论”部分添加了代码,我不知道它是如何添加的,因为它说太长了,无法让所有人都知道我实际上对我模拟用户的部分进行了评论,代码运行良好。