Exchange 2010 Team Calendar EWS ASP.NET

I'm trying to build a team calendar in ASP.net using EWS connecting to Exchange 2010. Looking at a single day I'd like to see User1, User2, User3 all side by side. I've found information to create calendar items but not display the XML of the calendar itself. Can someone show me an example of that?
LVL 1
gregbrainerdAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LeeDerbyshireCommented:
Can you tell us a bit more about how you're trying to do it?  Is it a single appointment item folder in Public Folders, and are you reading users' calendars directly?  What kind of XML are you hoping to see?  The only time you would see any XML is in the server's response to your EWS request, but this isn't something you would normally display to a user - it's just the standardised way that the server returns the information to you.  You still need to interpret it and display it.
0
gregbrainerdAuthor Commented:
Sure, I'm trying to build a website that would display an OWA style calendar but with multiple users. So at a glance you'd see my calendar, Bob's and Sally's calendar in the same view. Here is an example that was built for Exchange 2003 WebDAV which is not supported by 2007/2010.

http://www.codeproject.com/KB/aspnet/teamcalendar.aspx
0
LeeDerbyshireCommented:
So, the calendars are in mailboxes, not public folders?  I assume that you have permission to read the calendars, or are they configured so that anyone can access them?  If you can access them directly from the OWA URL:
https://server/owa/user@domain.com/?cmd=contents&module=calendar
your easiest option would be to create a simple html page with iframes pointing at each calendar.  Like:

<iframe src="https://server/owa/user1@domain.com/?cmd=contents&module=calendar"></iframe>
<iframe src="https://server/owa/user2@domain.com/?cmd=contents&module=calendar"></iframe>

etc.  Of course, if you want something that isn't like the OWA layout, then you will indeed need to make something yourself.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

gregbrainerdAuthor Commented:
Yes I would have permissions to the mailboxes. This is an intersting solution and is what I want the layout to appear exactly like but if you double click on a calendar appointment I'd rather redirect it to a custom window to appear that will write both to the calendar and to a SQL DB.

I can create calendar events using the following code to create new appointments.
Dim myAppt As New Appointment(myService)
        myAppt.Subject = "TEST"
        myAppt.Start = DateTime.Now
        myAppt.End = DateTime.Now.AddHours(1.5)
        myAppt.StartTimeZone = TimeZoneInfo.Local
        myAppt.Body = "My Calendar Event!"

        '//Make appointment reoccur
        myAppt.Recurrence = New Recurrence.WeeklyPattern(DateTime.Now, 1, DayOfWeek.Friday)

        '//Save to calendar
        myAppt.Save()

Open in new window

0
LeeDerbyshireCommented:
Okay, so I guess first thing you want is a list of the calendar items.  I don't use high-level EWS APIs (preferring to send/decode XML requests manually), but I can't recommend that you do the same, since I know that doesn't suit everyone (although if you really want to try it, I have something similar here http://www.leederbyshire.com/Articles/EWS-FindItem-Other-Mailbox-Exchange-2007.asp ).  Problem is, that means I don't have any 'normal' EWS code of my own to paste for you.  What I can tell you is that you want to use the EWS CalendarView object.  A search reveals that someone has used one to open a shared calendar here.  The article might be of some use to you:
http://stackoverflow.com/questions/5139408/accessing-shared-calendars-with-exchange-web-services
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gregbrainerdAuthor Commented:
I'll take a look at those examples and let you know what I figure out.
0
gregbrainerdAuthor Commented:
Okay, the leederbyshire is using XML and after futher study it appears that XML is not supported with VB.net and when trying that script as an HTM I get an permission denied even when modifying the following line

objXMLHTTP.Open "POST", strURL, false, strdomain & "\" & username, password


So, XML is out and I need to try a different approach to getting the calendar from OWA (Exchange 2010) into ASP.net
0
gregbrainerdAuthor Commented:
The example from stackoverflow gives me the info that I am looking for. But I'd like it to be in the OWA calendar format. Maybe I need to build my own calendar to place this in?


Imports Microsoft.Exchange.WebServices.Data
Imports Microsoft.Exchange.WebServices.Autodiscover


	Dim myService As New ExchangeService
        myService.Credentials = New WebCredentials("username@domain.local", "myPassw0rd")
        myService.Url = New Uri("https://fqdn.com/EWS/exchange.asmx")

        Dim _cal As New Microsoft.Exchange.WebServices.Data.FolderId(Microsoft.Exchange.WebServices.Data.WellKnownFolderName.Calendar, New Microsoft.Exchange.WebServices.Data.Mailbox("username@domain.local"))
        Dim _calendarView As New Microsoft.Exchange.WebServices.Data.CalendarView(DateTime.Now, DateTime.Now.AddDays(1))
        Dim apptCounter = 0

        For Each appointmentItem As Microsoft.Exchange.WebServices.Data.Appointment In myService.FindAppointments(_cal, _calendarView)
            apptCounter = apptCounter + 1
            Response.Write(appointmentItem.Subject)
            Response.Write("<br>")
            Response.Write(appointmentItem.Start.ToString & vbTab & appointmentItem.Duration.ToString)

            Response.Write("<br>")
            Response.Write(apptCounter)
        Next

Open in new window

0
LeeDerbyshireCommented:
You mean something that looks like the OWA calendar display?  Yes, you'd need to do all the layout yourself (<table/>s, etc,) once you'd got the data from Exchange.  It won't supply a nicely formatted calendar for you unless you use the existing web parts (which is basically what I was suggesting with the <iframe/>s), but then you can't get it to do the custom behaviour you are looking for.
0
gregbrainerdAuthor Commented:
Yes that was what I was trying to avoid. Okay, I appreciate your help :)
0
LeeDerbyshireCommented:
No problem.  Come back if you get stuck.  You can still add comments to this thread.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.