This is a migrated thread and some comments may be shown as answers.

Exchange Service Provider

12 Answers 127 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Vic
Top achievements
Rank 1
Vic asked on 12 Dec 2011, 06:00 PM
I am trying to use the Exchange connection to display a calendar within a web-based application and the Exchange Service provider works great if I am defining a user with their username and password but how do I make it work if I have access to another users account using my credentials?

12 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 13 Dec 2011, 02:33 PM
Hello Vic,

You can set the credential dynamically in Page_Init:
protected void Page_Init(object sender, EventArgs e) {
     ExchangeSchedulerProvider provider =
     new ExchangeSchedulerProvider("https:.../Exchange.asmx", "user_name", "pass_word", "domain_name");
     RadScheduler1.Provider = provider;
}

There is a sample you can download from this forum thread -
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/could-not-load-type-telerik-web-examples-scheduler-exchangeschedulerprovider.aspx#1725277

I hope this helps.

Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Vic
Top achievements
Rank 1
answered on 29 Dec 2011, 04:43 AM
But what about using a master account that has permissions to multiple accounts? I want to use a single account to login so I don't need each users password.
0
Peter
Telerik team
answered on 03 Jan 2012, 11:23 AM
Hi Vic,

The ExchangeSchedulerProvider has the following contructors:

/// <summary>
       /// Initializes a new instance of the <see cref="ExchangeSchedulerProvider"/> class.
       /// </summary>
       /// <param name="serverUrl">The exchange web service end-point URL. For example "http://dc1.litwareinc.com/EWS/Exchange.asmx".</param>
       /// <param name="username">The username to use for authentication.</param>
       /// <param name="password">The password to use for authentication.</param>
       /// <param name="domain">The domain name to use for authentication.</param>
       public ExchangeSchedulerProvider(string serverUrl, string username, string password, string domain)
           : this()
       {
           ServerUrl = serverUrl;
           Username = username;
           Password = password;
           Domain = domain;
       }
 
       /// <summary>
       /// Initializes a new instance of the <see cref="ExchangeSchedulerProvider"/> class.
       /// </summary>
       /// <param name="serverUrl">The exchange web service end-point URL. For example "http://dc1.litwareinc.com/EWS/Exchange.asmx".</param>
       /// <param name="credentials">Network credentials to use when connecting to the server.</param>
       public ExchangeSchedulerProvider(string serverUrl, NetworkCredential credentials)
           : this()
       {
           ServerUrl = serverUrl;
           Credentials = credentials;
       }
 
       /// <summary>
       /// Initializes a new instance of the <see cref="ExchangeSchedulerProvider"/> class.
       /// </summary>
       public ExchangeSchedulerProvider()
       {
 
       }

Could you please try using the second one which uses network credentials and let me know if this helps?

Greetings,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Vic
Top achievements
Rank 1
answered on 07 Jan 2012, 09:46 AM
when i connect programmatically it doesn't connect - i get a 401 unauthorized error.  but when i use the web.config it connects to whatever mailbox i define there.
0
Vic
Top achievements
Rank 1
answered on 01 Feb 2012, 02:23 AM
What would cause me to get a "The request failed with HTTP status 401: Unauthorized." error when setting the provider declaratively:

Dim Credentials As New Net.NetworkCredential("username", "password", "domain")

        Dim ExchangeSchedulerProvider As New ExchangeSchedulerProvider("https://exchangeserver/EWS/Exchange.asmx", Credentials)

        RadScheduler1.Provider = ExchangeSchedulerProvider

But when I set it via web.config - it connects fine...



0
Vic
Top achievements
Rank 1
answered on 01 Feb 2012, 02:52 AM
It seems like initialize in the exchangeservice provider is never called when set declaratively and thus it never really authenticates
0
Vic
Top achievements
Rank 1
answered on 01 Feb 2012, 02:57 AM
If i do not authenticate with the "network credentials", it works...
0
Peter
Telerik team
answered on 01 Feb 2012, 12:48 PM
Hello Vic,

Can you make sure you set the provider dynamically in the Page_Init event?

Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Betina
Top achievements
Rank 1
answered on 28 Mar 2012, 09:29 AM
Hi

I am having the excact same problem now, I try to set the provider with my networkcredentials in Page_Init but gets an 401 error, is there a solution?

I have updated my controls but that did not resolve the issue.
0
Peter
Telerik team
answered on 28 Mar 2012, 10:58 AM
Hello Betina,

We could never manage to replicate this problem locally so I am not sure what could be causing it. If you can open a support ticket and attach a sample of the issue there, we will look into it and hopefully find a solution.

Greetings,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Betina
Top achievements
Rank 1
answered on 02 Apr 2012, 08:03 AM

I havent much to send but my code are:

    Dim esb As New ExchangeServiceBinding()
    esb.Url = "https://OurExchangeServer/EWS/Exchange.asmx"
    Dim crd As New NetworkCredential("MyUSer", "MyPassword", "MyDomain")
    esb.Credentials = crd

    RadScheduler1.Provider = New ExchangeSchedulerProvider("https://OurExchangeServer/EWS/Exchange.asmx", crd)

0
Peter
Telerik team
answered on 03 Apr 2012, 01:36 PM
Hi Betina,

Thank you for the additional information. We will let you know if we discover something of interest regarding this case.

Kind regards,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Vic
Top achievements
Rank 1
Answers by
Peter
Telerik team
Vic
Top achievements
Rank 1
Betina
Top achievements
Rank 1
Share this question
or