ServiceProxy<TService> ServiceProxy<TService> ServiceProxy<TService> ServiceProxy<TService> Class

Definition

Provides an abstract base class to encapsulate service connection operations and user authentication management.

generic <typename TService>
 where TService : classpublic ref class ServiceProxy abstract : IDisposable
public abstract class ServiceProxy<TService> : IDisposable where TService : class
type ServiceProxy<'Service (requires 'Service : null)> = class
    interface IDisposable
Public MustInherit Class ServiceProxy(Of TService)
Implements IDisposable

Type Parameters

TService

Type: IDiscoveryService or IOrganizationService. A service that an instance of this class can access.

Inheritance
ServiceProxy<TService>ServiceProxy<TService>ServiceProxy<TService>ServiceProxy<TService>
Derived
Implements

Remarks

The two commonly used derived classes are DiscoveryServiceProxy and OrganizationServiceProxy.

Constructors

ServiceProxy<TService>(IServiceConfiguration<TService>, SecurityTokenResponse) ServiceProxy<TService>(IServiceConfiguration<TService>, SecurityTokenResponse) ServiceProxy<TService>(IServiceConfiguration<TService>, SecurityTokenResponse) ServiceProxy<TService>(IServiceConfiguration<TService>, SecurityTokenResponse)

Initializes a new instance of the ServiceProxy<TService> class using a service configuration and security token response.

ServiceProxy<TService>(IServiceConfiguration<TService>, ClientCredentials) ServiceProxy<TService>(IServiceConfiguration<TService>, ClientCredentials) ServiceProxy<TService>(IServiceConfiguration<TService>, ClientCredentials) ServiceProxy<TService>(IServiceConfiguration<TService>, ClientCredentials)

Initializes a new instance of the ServiceProxy<TService> class using a service configuration and client logon credentials.

ServiceProxy<TService>(IServiceManagement<TService>, SecurityTokenResponse) ServiceProxy<TService>(IServiceManagement<TService>, SecurityTokenResponse) ServiceProxy<TService>(IServiceManagement<TService>, SecurityTokenResponse) ServiceProxy<TService>(IServiceManagement<TService>, SecurityTokenResponse)

Initializes a new instance of the ServiceProxy<TService> class using a service management and security token response.

ServiceProxy<TService>(IServiceManagement<TService>, ClientCredentials) ServiceProxy<TService>(IServiceManagement<TService>, ClientCredentials) ServiceProxy<TService>(IServiceManagement<TService>, ClientCredentials) ServiceProxy<TService>(IServiceManagement<TService>, ClientCredentials)

Initializes a new instance of the ServiceProxy<TService> class using a service management and client logon credentials.

ServiceProxy<TService>(Uri, Uri, ClientCredentials, ClientCredentials) ServiceProxy<TService>(Uri, Uri, ClientCredentials, ClientCredentials) ServiceProxy<TService>(Uri, Uri, ClientCredentials, ClientCredentials) ServiceProxy<TService>(Uri, Uri, ClientCredentials, ClientCredentials)

Initializes a new instance of the ServiceProxy<TService> class using a service URI, a home realm URI, client logon credentials, and Windows Live device credentials.

Properties

ChannelFactory ChannelFactory ChannelFactory ChannelFactory

Gets a WCF channel factory that manages a single channel instance.

ClientCredentials ClientCredentials ClientCredentials ClientCredentials

Gets the login credentials of the client.

DeviceCredentials DeviceCredentials DeviceCredentials DeviceCredentials

Gets the Windows Live credentials of a registered device.

EndpointAutoSwitchEnabled EndpointAutoSwitchEnabled EndpointAutoSwitchEnabled EndpointAutoSwitchEnabled

Gets or sets a value that enables automatic switching from the organization’s current endpoint to an alternate endpoint.

EndpointSwitch EndpointSwitch EndpointSwitch EndpointSwitch

Gets the endpoint switch information from the web service configuration.

HomeRealmSecurityTokenResponse HomeRealmSecurityTokenResponse HomeRealmSecurityTokenResponse HomeRealmSecurityTokenResponse

Gets the security token response of the home realm.

HomeRealmUri HomeRealmUri HomeRealmUri HomeRealmUri

Gets the home realm URI.

IsAuthenticated IsAuthenticated IsAuthenticated IsAuthenticated

Gets a value indicating if the WCF channel has been authenticated.

SecurityTokenResponse SecurityTokenResponse SecurityTokenResponse SecurityTokenResponse

Gets the security token response.

ServiceChannel ServiceChannel ServiceChannel ServiceChannel

Gets the communication channel used to access a Microsoft Dynamics 365 service.

ServiceConfiguration ServiceConfiguration ServiceConfiguration ServiceConfiguration

Gets a service configuration.

ServiceManagement ServiceManagement ServiceManagement ServiceManagement

Gets a service management.

Timeout Timeout Timeout Timeout

Gets or sets the maximum amount of time a single channel operation has to complete before a timeout fault is raised on a service channel binding.

UserPrincipalName UserPrincipalName UserPrincipalName UserPrincipalName

Gets or sets the UPN that is an Internet-style login name for a user based on the Internet standard RFC 822.

Methods

Authenticate() Authenticate() Authenticate() Authenticate()

Closes the service channel and channel factory if they are open, and then invokes AuthenticateCore().

AuthenticateCore() AuthenticateCore() AuthenticateCore() AuthenticateCore()

Authenticates the client with a service.

AuthenticateCrossRealm() AuthenticateCrossRealm() AuthenticateCrossRealm() AuthenticateCrossRealm()

Invokes AuthenticateCrossRealmCore().

AuthenticateCrossRealmCore() AuthenticateCrossRealmCore() AuthenticateCrossRealmCore() AuthenticateCrossRealmCore()

Authenticates a user in a realm other than the realm that the Microsoft Dynamics 365 server is located in.

AuthenticateDevice() AuthenticateDevice() AuthenticateDevice() AuthenticateDevice()

Invokes AuthenticateDeviceCore().

AuthenticateDeviceCore() AuthenticateDeviceCore() AuthenticateDeviceCore() AuthenticateDeviceCore()

Authenticates a device with Windows Live.

CloseChannel(Boolean) CloseChannel(Boolean) CloseChannel(Boolean) CloseChannel(Boolean)

Closes a validated service channel.

Dispose() Dispose() Dispose() Dispose()

Custom implementation of Dispose that disposes the service channel and channel factory.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Custom implementation of Dispose that disposes the service channel and channel factory.

Finalize() Finalize() Finalize() Finalize()

Implicitly frees allocated service channel and service factory resources.

HandleFailover(Nullable<Boolean>) HandleFailover(Nullable<Boolean>) HandleFailover(Nullable<Boolean>) HandleFailover(Nullable<Boolean>)

For internal use only.

HandleFailover(BaseServiceFault, Nullable<Boolean>) HandleFailover(BaseServiceFault, Nullable<Boolean>) HandleFailover(BaseServiceFault, Nullable<Boolean>) HandleFailover(BaseServiceFault, Nullable<Boolean>)

For internal use only.

OnFactoryClosed(ChannelEventArgs) OnFactoryClosed(ChannelEventArgs) OnFactoryClosed(ChannelEventArgs) OnFactoryClosed(ChannelEventArgs)

Event handler virtual method for a channel factory that is in a closed state.

OnFactoryFaulted(ChannelFaultedEventArgs) OnFactoryFaulted(ChannelFaultedEventArgs) OnFactoryFaulted(ChannelFaultedEventArgs) OnFactoryFaulted(ChannelFaultedEventArgs)

Event handler virtual method for a channel factory that is in a faulted state.

OnFactoryOpened(ChannelEventArgs) OnFactoryOpened(ChannelEventArgs) OnFactoryOpened(ChannelEventArgs) OnFactoryOpened(ChannelEventArgs)

Event handler virtual method for a channel factory that is in an opened state.

SetBindingTimeout(Binding, TimeSpan, TimeSpan, TimeSpan) SetBindingTimeout(Binding, TimeSpan, TimeSpan, TimeSpan) SetBindingTimeout(Binding, TimeSpan, TimeSpan, TimeSpan) SetBindingTimeout(Binding, TimeSpan, TimeSpan, TimeSpan)

The maximum amount of time a single channel operation has to complete before a timeout fault is raised on a service channel binding.

ShouldRetry(MessageSecurityException, Nullable<Boolean>) ShouldRetry(MessageSecurityException, Nullable<Boolean>) ShouldRetry(MessageSecurityException, Nullable<Boolean>) ShouldRetry(MessageSecurityException, Nullable<Boolean>)

Checks a message security exception to determine if a service call should be attempted again.

SwitchToAlternateEndpoint() SwitchToAlternateEndpoint() SwitchToAlternateEndpoint() SwitchToAlternateEndpoint()

Switches the organization’s current endpoint to an alternate endpoint, if one is available.

ValidateAuthentication() ValidateAuthentication() ValidateAuthentication() ValidateAuthentication()

Authenticates the client and creates a new service channel.

Events

EndpointSwitched EndpointSwitched EndpointSwitched EndpointSwitched

Occurs when a failover recovery has completed and the organization’s current endpoint has been switched to an alternate endpoint.

EndpointSwitchRequired EndpointSwitchRequired EndpointSwitchRequired EndpointSwitchRequired

Occurs when a failover has occurred and a switch from the organization’s current endpoint to an alternate endpoint is required.

FactoryClosed FactoryClosed FactoryClosed FactoryClosed

Occurs when a channel factory is closed.

FactoryFaulted FactoryFaulted FactoryFaulted FactoryFaulted

Occurs when a channel factory is faulted.

FactoryOpened FactoryOpened FactoryOpened FactoryOpened

Occurs when a channel factory is opened.

Applies to