ExchangeService class

Represents a binding to the Exchange Web Services.
Inheritance

Constructors

ExchangeService.withVersion(ExchangeVersion requestedServerVersion)
Initializes a new instance of the

Properties

AcceptGzipEncoding bool
Gets or sets a value indicating whether GZip compression encoding should be accepted.
getter/setter pairinherited
ClientRequestId String?
Gets or sets the request id for the request.
getter/setter pairinherited
ConnectionGroupName String?
Gets or sets the name of the connection group for the request.
getter/setter pairinherited
CookieContainer CookieContainer
Gets or sets the cookie container.
getter/setter pairinherited
Credentials ExchangeCredentials?
Gets or sets the credentials used to authenticate with the Exchange Web Services. Setting the Credentials property automatically sets the UseDefaultCredentials to false.
getter/setter pairinherited
EnableScpLookup bool
Gets the time zone this service is scoped to.
getter/setter pair
Exchange2007CompatibilityMode bool
Gets or sets a value indicating whether Exchange2007 compatibility mode is enabled.
getter/setter pair
exchange2007CompatibilityMode bool
Exchange 2007 compatibility mode flag. (Off by default)
getter/setter pair
FileAttachmentContentHandler IFileAttachmentContentHandler?
Gets or sets the Id of the user that EWS should impersonate.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
HttpHeaders Map<String, String>
Gets or sets a flag to indicate whether the client requires the server side to return the request id.
no setterinherited
HttpResponseHeaders Map<String, String?>
Gets a collection of HTTP headers from the last response.
no setterinherited
HttpWebRequestFactory IEwsHttpWebRequestFactory
Gets or sets the HTTP web request factory.
getter/setter pairinherited
KeepAlive bool
Gets or sets if the request to the internet resource should contain a Connection HTTP header with the value Keep-alive
getter/setter pairinherited
OnResponseHeadersCaptured List<ResponseHeadersCapturedHandler>
Occurs when the http response headers of a server call is captured.
getter/setter pairinherited
OnSerializeCustomSoapHeaders List<CustomXmlSerializationDelegate>
Provides an event that applications can implement to emit custom SOAP headers in requests that are sent to Exchange.
getter/setter pairinherited
PreAuthenticate bool
Gets or sets a value that indicates whether HTTP pre-authentication should be performed.
getter/setter pairinherited
RequestedServerVersion ExchangeVersion
Gets the requested server version.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
SendClientLatencies bool
Gets a time zone definition generated from the time zone info to which this service is scoped.
getter/setter pairinherited
ServerInfo ExchangeServerInfo?
Gets information associated with the server that processed the last request. Will be null if no requests have been processed.
getter/setter pairinherited
SuppressXmlVersionHeader bool
For testing: suppresses generation of the SOAP version header.
getter/setter pairinherited
TargetServerVersion String?
Gets or sets the target server version string (newer than Exchange2013).
getter/setter pair
Timeout int
Gets or sets the timeout used when sending HTTP requests and when receiving HTTP responses, in milliseconds. Defaults to 100000.
getter/setter pairinherited
TimeZone → TimeZone?
Gets the time zone this service is scoped to.
no setterinherited
TraceEnabled bool
Gets or sets a value indicating whether tracing is enabled.
getter/setter pairinherited
TraceEnablePrettyPrinting bool
Gets or sets a value indicating whether trace output is pretty printed.
getter/setter pair
TraceFlags List<TraceFlags>
Gets or sets the trace flags.
getter/setter pairinherited
TraceListener ITraceListener
Gets or sets the trace listener.
getter/setter pairinherited
Url Uri?
Gets or sets the URL of the Exchange Web Services.
getter/setter pair
UseDefaultCredentials bool
Gets or sets a value indicating whether the credentials of the user currently logged into Windows should be used to authenticate with the Exchange Web Services. Setting UseDefaultCredentials to true automatically sets the Credentials property to null.
getter/setter pairinherited
UserAgent String
Gets or sets the user agent.
getter/setter pairinherited
WebProxt IWebProxy
no getterinherited
WebProxy IWebProxy?
Gets or sets the web proxy that should be used when sending requests to EWS. Set this property to null to use the default web proxy.
no setterinherited

Methods

AdjustServiceUriFromCredentials(Uri uri) Uri
Adjusts the service URI based on the current type of credentials.
AutodiscoverUrl(String emailAddress) Future<void>
Initializes the Url property to the Exchange Web Services URL for the specified e-mail address by calling the Autodiscover service.
AutodiscoverUrlWithCallback(String emailAddress, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback) Future<void>
Initializes the Url property to the Exchange Web Services URL for the specified e-mail address by calling the Autodiscover service.
BindToFolder(FolderId folderId, PropertySet propertySet) Future<Folder>
Binds to a folder.
BindToFolderGeneric<TFolder extends Folder>(FolderId folderId, PropertySet propertySet) Future<TFolder>
Binds to folder.
BindToItem(ItemId? itemId, PropertySet propertySet) Future<Item?>
Binds to multiple items in a single call to EWS.
BindToItemGeneric<TItem extends Item>(ItemId? itemId, PropertySet propertySet) Future<TItem>
Binds to item.
BindToItems(Iterable<ItemId> itemIds, PropertySet propertySet) Future<ServiceResponseCollection<GetItemResponse>>
Binds to multiple items in a single call to EWS.
BuildSubscribeToStreamingNotificationsRequest(Iterable<FolderId> folderIds, List<EventType> eventTypes) SubscribeToStreamingNotificationsRequest
Begins an asynchronous request to subscribe to streaming notifications. Calling this method results in a call to EWS.
BuildSyncFolderHierarchyRequest(FolderId syncFolderId, PropertySet propertySet, String? syncState) Future<SyncFolderHierarchyRequest>
Begins an asynchronous request to synchronize the sub-folders of a specific folder. Calling this method results in a call to EWS.
BuildSyncFolderItemsRequest(FolderId? syncFolderId, PropertySet propertySet, Iterable<ItemId>? ignoredItemIds, int maxChangesReturned, int numberOfDays, SyncFolderItemsScope syncScope, String? syncState) SyncFolderItemsRequest
Begins an asynchronous request to synchronize the items of a specific folder. Calling this method results in a call to EWS.
BuildUnsubscribeRequest(String? subscriptionId) UnsubscribeRequest
Begins an asynchronous request to unsubscribe from a subscription. Calling this method results in a call to EWS.
ConvertDateTimeToUniversalDateTimeString(DateTime value) String
Converts the date time to universal date time string.
inherited
ConvertStartDateToUnspecifiedDateTime(String? value) DateTime?
Converts xs:dateTime String with either "Z", "-00:00" bias, or "" suffixes to unspecified StartDate value ignoring the suffix.
inherited
ConvertUniversalDateTimeStringToLocalDateTime(String? value) DateTime?
Converts the universal date time String to local date time.
inherited
CreateAttachments(String? parentItemId, Iterable<Attachment?> attachments) Future<ServiceResponseCollection<CreateAttachmentResponse>>
Creates attachments.
CreateFolder(Folder folder, FolderId parentFolderId) Future<void>
Creates a folder. Calling this method results in a call to EWS.
CreateItem(Item item, FolderId? parentFolderId, MessageDisposition? messageDisposition, SendInvitationsMode? sendInvitationsMode) Future<void>
Creates multiple items in a single EWS call. Supported item classes are EmailMessage, Appointment, Contact, PostItem, Task and Item. CreateItems does not support items that have unsaved attachments.
DefaultAutodiscoverRedirectionUrlValidationCallback(String redirectionUrl) bool
Gets Out of Office (OOF) settings for a specific user. Calling this method results in a call to EWS.
DeleteAttachments(Iterable<Attachment?> attachments) Future<ServiceResponseCollection<DeleteAttachmentResponse>>
Deletes attachments.
DeleteFolder(FolderId? folderId, DeleteMode deleteMode) Future<void>
Deletes a folder. Calling this method results in a call to EWS.
DeleteItem(ItemId? itemId, DeleteMode deleteMode, SendCancellationsMode? sendCancellationsMode, AffectedTaskOccurrence? affectedTaskOccurrences, bool suppressReadReceipts) Future<void>
Deletes an item. Calling this method results in a call to EWS.
DeleteItems(Iterable<ItemId> itemIds, DeleteMode deleteMode, SendCancellationsMode sendCancellationsMode, AffectedTaskOccurrence affectedTaskOccurrences, [bool suppressReadReceipt = false]) Future<ServiceResponseCollection<ServiceResponse>>
Deletes multiple items in a single call to EWS.
DoOnSerializeCustomSoapHeaders(XmlWriter? writer) → void
Calls the custom SOAP header serialization event handlers, if defined.
inherited
EmptyFolder(FolderId? folderId, DeleteMode deleteMode, bool deleteSubFolders) Future<void>
Empties a folder. Calling this method results in a call to EWS.
FindFoldersWithFolderId(FolderId parentFolderId, SearchFilter? searchFilter, FolderView view) Future<FindFoldersResults>
Obtains a list of folders by searching the sub-folders of the specified folder.
FindFoldersWithWellKnownFolder(WellKnownFolderName parentFolderName, SearchFilter? searchFilter, FolderView view) Future<FindFoldersResults>
Obtains a list of folders by searching the sub-folders of each of the specified folders.
FindItems(WellKnownFolderName parentFolderName, String queryString, ViewBase view, Grouping groupBy) Future<GroupedFindItemsResults<Item>?>
Obtains a grouped list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsGeneric<TItem extends Item>(Iterable<FolderId?> parentFolderIds, SearchFilter? searchFilter, String? queryString, ViewBase view, Grouping? groupBy, ServiceErrorHandling errorHandlingMode) Future<ServiceResponseCollection<FindItemResponse<TItem>>>
Copies multiple items in a single call to EWS.
FindItemsWithFolderIdAndFilterAndView(FolderId parentFolderId, SearchFilter? searchFilter, ViewBase view) Future<FindItemsResults<Item>>
Obtains a list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndFilterAndViewAndGrouping(FolderId parentFolderId, SearchFilter searchFilter, ViewBase view, Grouping groupBy) Future<GroupedFindItemsResults<Item>?>
Obtains a grouped list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndQueryAndHighlightAndView(FolderId parentFolderId, String queryString, bool returnHighlightTerms, ViewBase view) Future<FindItemsResults<Item>?>
Obtains a list of items by searching the contents of a specific folder. Along with conversations, a list of highlight terms are returned. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndQueryAndHighlightAndViewAndGrouping(FolderId parentFolderId, String queryString, bool returnHighlightTerms, ViewBase view, Grouping groupBy) Future<GroupedFindItemsResults<Item>?>
Obtains a list of items by searching the contents of a specific folder. Along with conversations, a list of highlight terms are returned. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndQueryAndView(FolderId parentFolderId, String queryString, ViewBase view) Future<FindItemsResults<Item>?>
Obtains a list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndQueryAndViewAndGrouping(FolderId parentFolderId, String queryString, ViewBase view, Grouping groupBy) Future<GroupedFindItemsResults<Item>?>
Obtains a grouped list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndView(FolderId parentFolderId, ViewBase view) Future<FindItemsResults<Item>>
Obtains a list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithFolderIdAndViewAndGrouping(FolderId parentFolderId, ViewBase view, Grouping groupBy) Future<GroupedFindItemsResults<Item>?>
Obtains a grouped list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithWellKnownFolderAndFilterAndView(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ViewBase view) Future<FindItemsResults<Item>?>
Obtains a list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithWellKnownFolderAndFilterAndViewAndGrouping(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ViewBase view, Grouping groupBy) Future<GroupedFindItemsResults<Item>?>
Obtains a grouped list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithWellKnownFolderAndQueryAndView(WellKnownFolderName parentFolderName, String queryString, ViewBase view) Future<FindItemsResults<Item>?>
Obtains a list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
FindItemsWithWellKnownFolderAndView(WellKnownFolderName parentFolderName, ViewBase view) Future<FindItemsResults<Item>?>
Obtains a list of items by searching the contents of a specific folder. Calling this method results in a call to EWS.
GetAttachment(Attachment attachment, BodyType? bodyType, Iterable<PropertyDefinitionBase>? additionalProperties) Future<void>
Gets attachments.
GetAutodiscoverUrlWithExchangeVersionAndCallback(String emailAddress, ExchangeVersion requestedServerVersion, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback) Future<Uri>
Gets the EWS URL from Autodiscover.
GetEwsUrlFromResponse(GetUserSettingsResponse response, bool isExternal) Uri
Gets the EWS URL from Autodiscover GetUserSettings response.
InternalBindToFolders(Iterable<FolderId?> folderIds, PropertySet propertySet, ServiceErrorHandling errorHandling) Future<ServiceResponseCollection<GetFolderResponse>>
Binds to multiple folders in a single call to EWS.
InternalBindToItems(Iterable<ItemId?> itemIds, PropertySet propertySet, String? anchorMailbox, ServiceErrorHandling errorHandling) Future<ServiceResponseCollection<GetItemResponse>>
Binds to multiple items in a single call to EWS.
InternalCreateItems(Iterable<Item> items, FolderId? parentFolderId, MessageDisposition? messageDisposition, SendInvitationsMode? sendInvitationsMode, ServiceErrorHandling errorHandling) Future<ServiceResponseCollection<ServiceResponse>>
Marks all items in folder as read/unread. Calling this method results in a call to EWS.
InternalCreateResponseObject(ServiceObject responseObject, FolderId? parentFolderId, MessageDisposition messageDisposition) Future<List<Item>>
Create response object.
InternalDeleteItems(Iterable<ItemId?> itemIds, DeleteMode deleteMode, SendCancellationsMode? sendCancellationsMode, AffectedTaskOccurrence? affectedTaskOccurrences, ServiceErrorHandling errorHandling, bool suppressReadReceipts) Future<ServiceResponseCollection<ServiceResponse>>
Deletes multiple items in a single call to EWS.
InternalFindFolders(Iterable<FolderId> parentFolderIds, SearchFilter? searchFilter, FolderView view, ServiceErrorHandling errorHandlingMode) Future<ServiceResponseCollection<FindFolderResponse>>
Copies a folder. Calling this method results in a call to EWS.
InternalGetAttachments(Iterable<Attachment> attachments, BodyType? bodyType, Iterable<PropertyDefinitionBase>? additionalProperties, ServiceErrorHandling errorHandling) Future<ServiceResponseCollection<GetAttachmentResponse>>
Mark items as junk.
InternalLoadPropertiesForItems(Iterable<Item> items, PropertySet propertySet, ServiceErrorHandling errorHandling) Future<ServiceResponseCollection<ServiceResponse>>
Loads the properties of multiple items in a single call to EWS.
InternalProcessHttpErrorResponse(IEwsHttpWebResponse httpWebResponse, WebException webException, TraceFlags responseHeadersTraceFlag, TraceFlags responseTraceFlag) → void
Processes an HTTP error response
inherited
InternalUpdateItems(Iterable<Item> items, FolderId? savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode, ServiceErrorHandling errorHandling, bool suppressReadReceipt) Future<ServiceResponseCollection<UpdateItemResponse>>
Updates multiple items in a single EWS call. UpdateItems does not support items that have unsaved attachments.
IsTraceEnabledFor(TraceFlags traceFlag) bool
Determines whether tracing is enabled for specified trace flag(s).
inherited
LoadPropertiesForFolder(Folder folder, PropertySet propertySet) Future<void>
Obtains a list of folders by searching the sub-folders of the specified folder.
LoadPropertiesForItems(Iterable<Item> items, PropertySet propertySet) Future<ServiceResponseCollection<ServiceResponse>>
Obtains a list of appointments by searching the contents of a specific folder. Calling this method results in a call to EWS.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
PrepareHttpWebRequest(String methodName) Future<IEwsHttpWebRequest>
Initializes a new instance of the
PrepareHttpWebRequestForUrl(Uri url, bool acceptGzipEncoding, bool allowAutoRedirect) Future<IEwsHttpWebRequest>
Creates an HttpWebRequest instance and initializes it with the appropriate parameters, based on the configuration of this service object.
inherited
ProcessHttpErrorResponse(IEwsHttpWebResponse httpWebResponse, WebException webException) → void
Processes an HTTP error response.
override
ProcessHttpResponseHeaders(TraceFlags traceType, IEwsHttpWebResponse response) → void
Traces the HTTP response headers.
inherited
ResolveName(String? nameToResolve, Iterable<FolderId>? parentFolderIds, ResolveNameSearchLocation searchScope, bool returnContactDetails, PropertySet? contactDataPropertySet) Future<NameResolutionCollection>
Finds contacts in the Global Address List and/or in specific contact folders that have names that match the one passed as a parameter. Calling this method results in a call to EWS.
ResolveNameSimple(String nameToResolve) Future<NameResolutionCollection>
Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter. Calling this method results in a call to EWS.
ResolveNameWithFolderIdsAndSearchScopeAndDetails(String nameToResolve, Iterable<FolderId>? parentFolderIds, ResolveNameSearchLocation searchScope, bool returnContactDetails) Future<NameResolutionCollection>
Finds contacts in the Global Address List and/or in specific contact folders that have names that match the one passed as a parameter. Calling this method results in a call to EWS.
ResolveNameWithSearchScopeAndDetails(String nameToResolve, ResolveNameSearchLocation searchScope, bool returnContactDetails) Future<NameResolutionCollection>
Finds contacts in the Global Address List that have names that match the one passed as a parameter. Calling this method results in a call to EWS.
ResolveNameWithSearchScopeAndDetailsAndPropertySet(String nameToResolve, ResolveNameSearchLocation searchScope, bool returnContactDetails, PropertySet contactDataPropertySet) Future<NameResolutionCollection?>
Finds contacts in the Global Address List that have names that match the one passed as a parameter. Calling this method results in a call to EWS.
SendItem(Item item, FolderId? savedCopyDestinationFolderId) Future<void>
Sends an item.
SetContentType(IEwsHttpWebRequest request) → void
Sets the type of the content.
override
SetCustomUserAgent(String userAgent) → void
Register the custom auth module to support non-ascii upn authentication if the server supports that
inherited
SubscribeToStreamingNotifications(Iterable<FolderId> folderIds, List<EventType> eventTypes) Future<StreamingSubscription>
Retrieves the latests events associated with a pull subscription. Calling this method results in a call to EWS.
SyncFolderHierarchy(FolderId syncFolderId, PropertySet propertySet, String? syncState) Future<ChangeCollection<FolderChange>>
Synchronizes the sub-folders of a specific folder. Calling this method results in a call to EWS.
SyncFolderItems(FolderId? syncFolderId, PropertySet propertySet, Iterable<ItemId>? ignoredItemIds, int maxChangesReturned, SyncFolderItemsScope syncScope, String? syncState) Future<ChangeCollection<ItemChange>>
Synchronizes the items of a specific folder. Calling this method results in a call to EWS.
SyncFolderItemsWithNumberOfDays(FolderId? syncFolderId, PropertySet propertySet, Iterable<ItemId>? ignoredItemIds, int maxChangesReturned, int numberOfDays, SyncFolderItemsScope syncScope, String? syncState) Future<ChangeCollection<ItemChange>>
Synchronizes the items of a specific folder. Calling this method results in a call to EWS.
toString() String
A string representation of this object.
inherited
TraceHttpRequestHeaders(TraceFlags traceType, IEwsHttpWebRequest request) → void
Traces the HTTP request headers.
inherited
TraceMessage(TraceFlags traceType, String logEntry) → void
Logs the specified String to the TraceListener if tracing is enabled.
inherited
TraceXml(TraceFlags traceType, MemoryStream stream) → void
Logs the specified XML to the TraceListener if tracing is enabled.
inherited
Unsubscribe(String? subscriptionId) → void
Expands a group by retrieving a list of its members. Calling this method results in a call to EWS.
UpdateFolder(Folder folder) Future<void>
Updates a folder.
UpdateItem(Item item, FolderId? savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode, [bool suppressReadReceipts = false]) Future<Item?>
Updates an item.
UpdateItems(Iterable<Item> items, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode, bool suppressReadReceipts) Future<ServiceResponseCollection<UpdateItemResponse>>
Updates multiple items in a single EWS call. UpdateItems does not support items that have unsaved attachments.
Validate() → void
GetClientAccessToken
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

IsMajorMinor(String versionPart) bool
ValidateTargetVersion(String? version) → void
Validates a new-style version string. This validation is not as strict as server-side validation.