Exchange 2007 SP1 introduces some new additions and changes to the functionality that is exposed by Exchange Web Services, including versioning functionality, access to public folders, support for delegate management, improvements to delegate access, and changes to permissions and identifiers.
Versioning
Exchange 2007 SP1 introduces a new SOAP header element that is used to version SOAP requests. The new SOAP header is required to identify a client as Exchange 2007 SP1–compliant. The following example shows the RequestServerVersion SOAP header.
<soap:Header>
<t:RequestServerVersion Version="Exchange2007_SP1"/>
</soap:Header>
The RequestServerVersion SOAP header is set on the ExchangeServiceBinding object that is auto-generated by using wsdl.exe. The following example shows you how to set the version by using the auto-generated proxy:
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.RequestServerVersionValue = new RequestServerVersion();
esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;
Public Folder Access
Exchange 2007 SP1 adds access to public folders. Exchange Web Services in Exchange 2007 SP1 includes the following functionality:
-
Access to the public folder hierarchy.
-
Access to detailed information about public folders.
-
Access to detailed information about public folder items.
-
The ability to create post items.
-
Public folder items synchronization.
-
Subscription notifications for public folders.
The following example shows you how to search the public folders root.
// Create the request.
FindFolderType request = new FindFolderType();
// Search the public folder root.
request.ParentFolderIds = new DistinguishedFolderIdType[1];
request.ParentFolderIds[0] = new DistinguishedFolderIdType();
(request.ParentFolderIds[0] as DistinguishedFolderIdType).Id = DistinguishedFolderIdNameType.publicfoldersroot;
// Return all the immediate child public folders in the public folder root.
request.Traversal = FolderQueryTraversalType.Shallow;
// Request the default properties.
request.FolderShape = new FolderResponseShapeType();
request.FolderShape.BaseShape = DefaultShapeNamesType.Default;
// Send the request and get the response.
FindFolderResponseType response = esb.FindFolder(request);
Delegate Management
Delegate management is already available in MAPI, Microsoft Office Outlook, and the Exchange Management Shell. Support for delegate management is included in Exchange Web Services in Exchange 2007 SP1. This includes the ability to do the following:
-
Add new delegates
-
Retrieve and update existing delegate permissions
-
Remove existing delegates
Improved Delegate Access
Exchange 2007 SP1 introduces the following improvements to Exchange Web Services delegate access:
-
Delegates can open the folders of a principal and manipulate items based on folder-level permissions.
-
Delegates can create and send meeting messages on behalf of the principal.
-
Delegates can receive meeting messages that are forwarded by the principal and respond to them for the principal.
-
Users who have owner rights on a shared mailbox can open the mailbox and act as the owner.
-
Delegates can create notification subscriptions on folders in the mailbox of the principal.
Folder-Level Permissions
Exchange 2007 SP1 introduces access to Exchange Web Services folder-level permissions. This includes the following functionality:
-
Clients can query and configure the sharing of permissions on the folder.
-
Clients can retrieve the effective rights to get the effective permission for the logon user.
-
Free/busy calendar folder permissions are exposed.
Identifier Translation
Exchange 2007 SP1 includes a new method for converting different item identifiers. This method supports public folders, mailbox folders, and item identifiers. The following are the supported identifier formats:
-
The initial release of Exchange 2007 Exchange Web Services identifiers. These are the identifiers that Exchange Web Services creates and consumes for folders and items in Exchange 2007.
-
Exchange Web Services SP1 identifiers. These are the identifiers that Exchange Web Services creates and consumes for folders and items in Exchange 2007 SP1. The identifier format is different in Exchange 2007 SP1.
-
EntryID identifiers. These are provided by MAPI components.
-
Outlook Web Access identifiers. These are the identifiers that are created by Outlook Web Access and offered to consumers in the query string of the Outlook Web Access URL.
-
Availability Calendar ID identifiers. These identifiers are hexadecimal-encoded entry IDs that are used by the Availability feature to represent calendar items in a GetUserAvailability response.
The SOAP body that contains the XML message for converting identifiers is fairly straightforward. The following example shows the XML that is used in a request to convert an Outlook Web Access identifier to an Exchange Web Services identifier.
<ConvertId xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
DestinationFormat="EwsId">
<SourceIds>
<t:AlternateId Format="OwaId" Id="AAMkAGZhN2IxYTA0LWNiNzItN="
Mailbox="user1@example.com"/>
</SourceIds>
The following is an example of the autogenerated proxy objects that are used to generate the XML that is sent to the Exchange server. This example shows the conversion of an Outlook Web Access identifier to a MAPI PR_ENTRYID identifier.
// Create a request to convert identifiers.
ConvertIdType request = new ConvertIdType();
request.SourceIds = new AlternateIdType[1];
request.SourceIds[0] = new AlternateIdType();
// Convert from the Outlook Web Access identifier format to an PR_ENTRYID identifier.
request.SourceIds[0].Format = IdFormatType.OwaId;
(request.SourceIds[0] as AlternateIdType).Id = "RgAAAAAS2%";
(request.SourceIds[0] as AlternateIdType).Mailbox = "User1@example.com";
request.DestinationFormat = IdFormatType.EntryId;
New Identifier Format
The Exchange Web Services identifiers for folders and items in Exchange 2007 SP1 differ from the identifiers in the initial release of Exchange 2007. In Exchange 2007, the primary SMTP address is embedded in the identifier format. Because primary SMTP addresses can change, identifiers that are cached on a client will not match identifiers of items on the server if the primary SMTP address is updated, and attempts to reference the item will fail. In Exchange 2007 SP1, the identifiers encode a mailbox identifier instead of the primary SMTP address to uniquely identify the item or folder.
If an Exchange 2007 client sends requests against a computer that is running Exchange 2007 SP1, the identifier will work unless the SMTP address has changed. If the SMTP address has changed, the Exchange 2007 client must resynchronize.