ServiceProxy<TService> Class
Applies To: Dynamics CRM 2015
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
generic<typename TService>
where TService : ref class
public ref class ServiceProxy abstract : IDisposable
[<AbstractClass>]
type ServiceProxy<'TService when 'TService : not struct> =
class
interface IDisposable
end
Public MustInherit Class ServiceProxy(Of TService As Class)
Implements IDisposable
Type Parameters
- TService
Type: IDiscoveryService or IOrganizationService. A service that an instance of this class can access.
Constructors
Name | Description | |
---|---|---|
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 theServiceProxy<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
Name | Description | |
---|---|---|
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 CRM 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
Name | Description | |
---|---|---|
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 CRM 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. |
|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | Implicitly frees allocated service channel and service factory resources.(Overrides Object.Finalize().) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
HandleFailover(BaseServiceFault, Nullable<Boolean>) | For internal use only. |
|
HandleFailover(Nullable<Boolean>) | For internal use only. |
|
MemberwiseClone() | (Inherited from Object.) |
|
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. |
|
ToString() | (Inherited from Object.) |
|
ValidateAuthentication() | Authenticates the client and creates a new service channel. |
Events
Name | Description | |
---|---|---|
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. |
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
© 2016 Microsoft. All rights reserved. Copyright