DOCX

WORKING WITH THE EXCHANGE SERVICES - FREE-BUSY SERVICE

By Stanley Mcdonald,2014-07-08 10:11
6 views 0
HANDS-ON LAB. WORKING WITH EXCHANGE SERVICES - FREE-BUSY SERVICE. LAB VERSION: 1.0. LAST UPDATED: 6/22/2011. CONTENTS. OVERVIEW 3. SYSTEM REQUIREMENTS 3 ...

Hands-On Lab

    Working with Exchange Services - Free-Busy

    Service

Lab version: 1.0

    Last updated: 7/8/2012

CONTENTS

    OVERVIEW ............................................................................................................................................. 3

    System Requirements 3

    EXERCISE 1: WORKING WITH THE EXCHANGE FREE-BUSY SERVICE ............................................ 3

    Task 1 Beginning the Exercise ........................................................................................................ 3

    Task 2 Querying the Free-Busy Service .......................................................................................... 4

    SUMMARY .............................................................................................................................................. 6

Overview

    Lab Time: 45 minutes

    Lab Folder: C:\%Office365TrainingKit%\Labs\10.3\Source\Before

    The After folder contains the completed lab exercises.

    Lab Overview: The Microsoft Exchange Web Services (EWS) Managed API 1.1 provides an intuitive managed API for developing client and server applications that leverage Exchange data and business logic, whether Exchange is running on premises or in the cloud. The EWS Managed API 1.1 makes Exchange Web Services SOAP calls “under the covers” so many environments are already configured for EWS Managed API 1.1.

    In this lab, you will use the EWS Managed API 1.1 to:

    ; Work with Exchange business logic services such as the Free-Busy Service.

System Requirements

    You must have the following items to complete this lab:

    ; Microsoft Visual Studio 2010

    ; Exchange Web Services Managed API 1.1 SDK

    ; Two accounts configured to have Exchange mailboxes, referred to as the primary and secondary

    lab users in this lab.

    Exercise 1: Working with the Exchange Free-Busy Service

    Task 1 Beginning the Exercise

    In this task, you will open the project and configure it to run with your accounts.

    1. Navigate to Start >> All Programs >> Microsoft Visual Studio 2010.

    2. Click on the Microsoft Visual Studio 2010 icon to start Visual Studio 2010.

    3. Select File >> Open Project.

    4. Navigate to the folder C:\%Office365TrainingKit%\Labs\10.3\Source\Before\

    EWSMA_FreeBusy.sln.

    5. Open the EWSMA_FreeBusy project.

6. In Solution Explorer, open the app.config file.

    7. Change the PrimaryLabUserId and SecondaryLabUserId values to your primary and

    secondary lab accounts.

    8. Open Outlook 2010 and create three appointments in the primary lab user’s Calendar

    throughout the day.

    9. Start a remote desktop session as the secondary lab user. 10. Open Outlook 2010 and create three appointments in the secondary lab user’s Calendar

    throughout the day. Make sure one of them overlaps with one of the primary lab user’s

    appointments.

    Task 2 Querying the Free-Busy Service

    In this task, you will query the free-busy service to find available appointment times with the secondary

    lab user.

    1. Navigate to TODO: 10.3.1.

    2. Add the following code after the TODO: 10.3.1 comment. This creates a list of users for

    whom you want to query availability information.

    C#

    List attendees = new List();

    attendees.Add(new AttendeeInfo()

     {

     SmtpAddress = _primaryLabUserId,

     AttendeeType = MeetingAttendeeType.Organizer

     });

    attendees.Add(new AttendeeInfo()

     {

     SmtpAddress = _secondaryLabUserId,

     AttendeeType = MeetingAttendeeType.Required

     });

3. Navigate to TODO: 10.3.2.

    4. Add the following code after the TODO: 10.3.2 comment. This defines the requirements for

    the call to the free-busy service.

    C#

    AvailabilityOptions options = new AvailabilityOptions();

    options.MeetingDuration = 60;

    options.MaximumNonWorkHoursSuggestionsPerDay = 4;

    options.MinimumSuggestionQuality = SuggestionQuality.Good;

    options.RequestedFreeBusyView = FreeBusyViewType.FreeBusy;

    GetUserAvailabilityResults results =

     _service.GetUserAvailability(

     attendees,

     new TimeWindow(DateTime.Now, DateTime.Now.AddDays(1)),

     AvailabilityData.FreeBusyAndSuggestions,

     options);

    5. Un-comment code surrounded by /* … */ block to display the results of the free-busy

    service query.

    6. Go to Debug >> Start Without Debugging or [Ctrl]+[F5] to start the application.

    7. The console will display a list of suggested appointment times and their quality.

    8. Open the primary lab user’s calendar in Outlook 2010 and verify that the time slots during

    the suggested meeting times do not conflict with any appointments.

    9. Open the secondary lab user’s calendar in Outlook 2010 and verify that the time slots during

    the suggested meeting times do not conflict with any appointments. 10. Choose one of the suggested meeting times.

    11. Open your Outlook calendar to verify that the appointment was scheduled.

    12. Close the console application.

    TimeWindow must span into the next day or the GetUserAvailability call will throw an exception.

    Summary

    In this lab, you used the EWS Managed API to build simple applications that leverage Exchange 2010 data and business logic. You used the Exchange Free-Busy Service to search for available meeting times for a set of users. Finally, you saw how to subscribe to push notifications on the Exchange Server and listen for them using a WCF service.

Report this document

For any questions or suggestions please email
cust-service@docsford.com