TechReady 2007 Talk: Developing with Exchange Web Services

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Topic Last Modified: 2007-08-23

By David Claux and Rebecca Zou

On February 8, 2007, Rebecca and I hosted a TechReady 4 breakout session titled Exchange Web Services: Developing for Exchange Server 2007. The purpose of this session was to show how easy it is to integrate Microsoft Exchange Server 2007 data within line-of-business applications and third-party solutions by using the new Exchange Web Services feature.

This article provides an overview of the samples that we demonstrated in the breakout session. To download the slides and sample code, see TechReady 2007 Exchange Web Services Samples.

Support Policy

The samples that are provided with this article are for information only and are not for use in a production environment. These samples are not supported.

Exchange Web Services Samples

The TechReady 2007 Exchange Web Services Samples download includes the following projects:

  • CreateMeetingAndSendInvitationsDemo
  • AutodiscoveryDemo
  • PullNotificationsDemo
  • AvailabilityDemo

The download also includes a supporting project named EWSProxies, which creates an assembly called EWSProxies.dll that provides access to parts of Exchange Web Services that the samples require. Each sample references the EWSProxies project and uses the methods and properties in that project to access Exchange Web Services.

CreateMeetingAndSendInvitationsDemo

The CreateMeetingAndSendInvitationsDemo sample uses Exchange Web Services to create a meeting in one user's calendar and then invite another user to the meeting. This sample demonstrates how Exchange Web Services helps simplify previously lengthy implementations of common operations. The WebDAV sample that performs the same function has many more lines of code than the CreateMeetingAndSendInvitationsDemo sample.

AutodiscoveryDemo

The AutodiscoveryDemo sample uses the specified autodiscovery URL to look up the Exchange Web Services binding information for the specified user. The form in the sample displays the XML of the autodiscovery response as text.

PullNotificationsDemo

The PullNotificationsDemo sample creates a pull notification subscription on a user's mailbox. When you click the button on the form, the sample sends a message to that user from a second user. The sample periodically retrieves a list of new events that are associated with the subscription to determine whether there are any new messages in the first user's mailbox. It then displays the results in a text box.

AvailabilityDemo

The AvailabilityDemo sample gets availability information for two specified users and displays that information in a text box. The sample also enables you to get Out of Office (OOF) settings information about the first user by selecting the OOF Settings tab and clicking the button on the form.

Setting Up the Samples

Before you run any of the samples, you must change the code to reflect your specific environment. The following table lists the changes that you must make to the code for each sample.

Sample code changes

Project File Name Line Change

EWSProxies

ServiceSession.cs

32

Change the value of ServiceUrl to match the URL of the Exchange Web Services end point in your environment.

AutodiscoveryDemo

AutodiscoveryDemoForm.cs

27

Change the username and password that is specified in the ServiceSession constructor to match the username and password of a user who has a mailbox.

AutodiscoveryDemo

AutodiscoveryDemoForm.cs

37

Change the e-mail address specified in the call to the GetOutlookConfigurationMethod to match the e-mail address of the user for which the sample will perform autodiscovery.

AutodiscoveryDemo

AutodiscoveryDemoForm.cs

38

Change the URL that is specified in the call to the GetOutlookConfigurationMethod to match the autodiscover URL in your environment.

AvailabilityDemo

AvailabilityDemoForm.cs

26

Change the values set to "user1" and "user2" to match usernames that have mailboxes on the Exchange server.

AvailabilityDemo

AvailabilityDemoForm.cs

31

Change the domain name near the end of the line to match the domain name that is used for the e-mail addresses of the users who are specified on line 23.

AvailabilityDemo

AvailabilityDemoForm.cs

35

Change the username and password that is specified in the ServiceSession constructor to match the username and password of the user who is making the Exchange Web Services requests.

CreateMeetingAndSendInvitationsDemo

CreateMeetingAndSendInvitationsForm.cs

18

Change the username and password that is specified in the ServiceSession constructor to match the username and password of the user who is making the Exchange Web Services requests.

CreateMeetingAndSendInvitationsDemo

CreateMeetingAndSendInvitationsForm.cs

30

Change the e-mail address that is specified in the call to the CreateMeetingAndSendInvitations method to match the e-mail address of the user to whom the sample will send the meeting invitation.

PullNotificationsDemo

PullNotificationsDemoForm.cs

28

Change the username and password that is specified in the ServiceSession constructor to match the username and password of a user who has a mailbox.

PullNotificationsDemo

PullNotificationsDemoForm.cs

29

Change the username and password that is specified in the ServiceSession constructor to match the username and password of a user who has a different mailbox than the user who was specified on line 25.

PullNotificationsDemo

PullNotificationsDemoForm.cs

45

Change "user1", who was specified in the call to the SendMessage method, to the e-mail address for the user whom you specified in line 26.