Compartir a través de


ServiceProxy<TService> Class

 

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)

Inheritance Hierarchy

System.Object
  Microsoft.Xrm.Sdk.Client.ServiceProxy<TService>
    Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy
    Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy

Syntax

public abstract class ServiceProxy<TService> : IDisposable
where TService : class
Public MustInherit Class ServiceProxy(Of TService As Class)
    Implements IDisposable

Type Parameters

Constructors

Name Description
System_CAPS_protmethod ServiceProxy<TService>(IServiceConfiguration<TService>, ClientCredentials)

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

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

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

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

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

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

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

System_CAPS_protmethod 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

Name Description
System_CAPS_protproperty ChannelFactory

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

System_CAPS_pubproperty ClientCredentials

Gets the login credentials of the client.

System_CAPS_pubproperty DeviceCredentials

Gets the Windows Live credentials of a registered device.

System_CAPS_pubproperty EndpointAutoSwitchEnabled

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

System_CAPS_pubproperty EndpointSwitch

Gets the endpoint switch information from the web service configuration.

System_CAPS_pubproperty HomeRealmSecurityTokenResponse

Gets the security token response of the home realm.

System_CAPS_pubproperty HomeRealmUri

Gets the home realm URI.

System_CAPS_pubproperty IsAuthenticated

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

System_CAPS_pubproperty SecurityTokenResponse

Gets the security token response.

System_CAPS_pubproperty ServiceChannel

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

System_CAPS_pubproperty ServiceConfiguration

Gets a service configuration.

System_CAPS_pubproperty ServiceManagement

Gets a service management.

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

System_CAPS_pubproperty UserPrincipalName

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

Methods

Name Description
System_CAPS_pubmethod Authenticate()

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

System_CAPS_protmethod AuthenticateCore()

Authenticates the client with a service.

System_CAPS_pubmethod AuthenticateCrossRealm()

Invokes AuthenticateCrossRealmCore.

System_CAPS_protmethod AuthenticateCrossRealmCore()

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

System_CAPS_pubmethod AuthenticateDevice()

Invokes AuthenticateDeviceCore.

System_CAPS_protmethod AuthenticateDeviceCore()

Authenticates a device with Windows Live.

System_CAPS_protmethod CloseChannel(Boolean)

Closes a validated service channel.

System_CAPS_pubmethod Dispose()

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

System_CAPS_protmethod Dispose(Boolean)

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

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

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

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod HandleFailover(BaseServiceFault, Nullable<Boolean>)

For internal use only.

System_CAPS_protmethod HandleFailover(Nullable<Boolean>)

For internal use only.

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethod OnFactoryClosed(ChannelEventArgs)

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

System_CAPS_protmethod OnFactoryFaulted(ChannelFaultedEventArgs)

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

System_CAPS_protmethod OnFactoryOpened(ChannelEventArgs)

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

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

System_CAPS_protmethod ShouldRetry(MessageSecurityException, Nullable<Boolean>)

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

System_CAPS_pubmethod SwitchToAlternateEndpoint()

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

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_protmethod ValidateAuthentication()

Authenticates the client and creates a new service channel.

Events

Name Description
System_CAPS_pubevent EndpointSwitched

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

System_CAPS_pubevent EndpointSwitchRequired

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

System_CAPS_pubevent FactoryClosed

Occurs when a channel factory is closed.

System_CAPS_pubevent FactoryFaulted

Occurs when a channel factory is faulted.

System_CAPS_pubevent FactoryOpened

Occurs when a channel factory is opened.

Remarks

The two commonly used derived classes are DiscoveryServiceProxy and OrganizationServiceProxy.

Thread Safety

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

See Also

Microsoft.Xrm.Sdk.Client Namespace
Active Directory and claims-based authentication

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright