Del via


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

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

Inheritance
ServiceProxy<TService>
Derived
Implements

Remarks

The two commonly used derived classes are DiscoveryServiceProxy and OrganizationServiceProxy.

Constructors

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

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

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

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

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

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

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

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

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

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

ClientCredentials

Gets the login credentials of the client.

DeviceCredentials

Gets the Windows Live credentials of a registered device.

EndpointAutoSwitchEnabled

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

EndpointSwitch

Gets the endpoint switch information from the web service configuration.

HomeRealmSecurityTokenResponse

Gets the security token response of the home realm.

HomeRealmUri

Gets the home realm URI.

IsAuthenticated

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

SecurityTokenResponse

Gets the security token response.

ServiceChannel

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

ServiceConfiguration

Gets a service configuration.

ServiceManagement

Gets a service management.

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

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

Methods

Authenticate()

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

AuthenticateCore()

Authenticates the client with a service.

AuthenticateCrossRealm()

Invokes AuthenticateCrossRealmCore().

AuthenticateCrossRealmCore()

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

AuthenticateDevice()

Invokes AuthenticateDeviceCore().

AuthenticateDeviceCore()

Authenticates a device with Windows Live.

CloseChannel(Boolean)

Closes a validated service channel.

Dispose()

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

Dispose(Boolean)

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

Finalize()

Implicitly frees allocated service channel and service factory resources.

HandleFailover(BaseServiceFault, Nullable<Boolean>)

For internal use only.

HandleFailover(Nullable<Boolean>)

For internal use only.

OnFactoryClosed(ChannelEventArgs)

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

OnFactoryFaulted(ChannelFaultedEventArgs)

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

OnFactoryOpened(ChannelEventArgs)

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

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>)

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

SwitchToAlternateEndpoint()

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

ValidateAuthentication()

Authenticates the client and creates a new service channel.

Events

EndpointSwitched

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

EndpointSwitchRequired

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

FactoryClosed

Occurs when a channel factory is closed.

FactoryFaulted

Occurs when a channel factory is faulted.

FactoryOpened

Occurs when a channel factory is opened.

Applies to