ServiceProxy<TService> Class

 

Updated: November 29, 2016

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

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

Namespace:   Microsoft.Xrm.Sdk.Client
Assembly:  Microsoft.Xrm.Sdk (in Microsoft.Xrm.Sdk.dll)


public abstract class ServiceProxy<TService> : IDisposable
where TService : class

Type Parameters

TService

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

NameDescription
System_CAPS_protmethodServiceProxy<TService>(IServiceConfiguration<TService>, ClientCredentials)

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

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

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

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

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

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

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

System_CAPS_protmethodServiceProxy<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.

NameDescription
System_CAPS_protpropertyChannelFactory

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

System_CAPS_pubpropertyClientCredentials

Gets the login credentials of the client.

System_CAPS_pubpropertyDeviceCredentials

Gets the Windows Live credentials of a registered device.

System_CAPS_pubpropertyEndpointAutoSwitchEnabled

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

System_CAPS_pubpropertyEndpointSwitch

Gets the endpoint switch information from the web service configuration.

System_CAPS_pubpropertyHomeRealmSecurityTokenResponse

Gets the security token response of the home realm.

System_CAPS_pubpropertyHomeRealmUri

Gets the home realm URI.

System_CAPS_pubpropertyIsAuthenticated

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

System_CAPS_pubpropertySecurityTokenResponse

Gets the security token response.

System_CAPS_pubpropertyServiceChannel

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

System_CAPS_pubpropertyServiceConfiguration

Gets a service configuration.

System_CAPS_pubpropertyServiceManagement

Gets a service management.

System_CAPS_pubpropertyTimeout

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.

System_CAPS_pubpropertyUserPrincipalName

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

NameDescription
System_CAPS_pubmethodAuthenticate()

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

System_CAPS_protmethodAuthenticateCore()

Authenticates the client with a service.

System_CAPS_pubmethodAuthenticateCrossRealm()
System_CAPS_protmethodAuthenticateCrossRealmCore()

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

System_CAPS_pubmethodAuthenticateDevice()
System_CAPS_protmethodAuthenticateDeviceCore()

Authenticates a device with Windows Live.

System_CAPS_protmethodCloseChannel(Boolean)

Closes a validated service channel.

System_CAPS_pubmethodDispose()

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

System_CAPS_protmethodDispose(Boolean)

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

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

Implicitly frees allocated service channel and service factory resources.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodHandleFailover(BaseServiceFault, Nullable<Boolean>)

For internal use only.

System_CAPS_protmethodHandleFailover(Nullable<Boolean>)

For internal use only.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodOnFactoryClosed(ChannelEventArgs)

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

System_CAPS_protmethodOnFactoryFaulted(ChannelFaultedEventArgs)

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

System_CAPS_protmethodOnFactoryOpened(ChannelEventArgs)

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

System_CAPS_protmethodSystem_CAPS_staticSetBindingTimeout(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.

System_CAPS_protmethodShouldRetry(MessageSecurityException, Nullable<Boolean>)

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

System_CAPS_pubmethodSwitchToAlternateEndpoint()

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

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_protmethodValidateAuthentication()

Authenticates the client and creates a new service channel.

NameDescription
System_CAPS_pubeventEndpointSwitched

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

System_CAPS_pubeventEndpointSwitchRequired

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

System_CAPS_pubeventFactoryClosed

Occurs when a channel factory is closed.

System_CAPS_pubeventFactoryFaulted

Occurs when a channel factory is faulted.

System_CAPS_pubeventFactoryOpened

Occurs when a channel factory is opened.

The two commonly used derived classes are DiscoveryServiceProxy and OrganizationServiceProxy.

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright

Community Additions

Show: