Compartir a través de


OrganizationServiceProxy Class

 

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

Implements IOrganizationService and provides an authenticated WCF channel to the organization service.

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

Syntax

public class OrganizationServiceProxy : ServiceProxy<IOrganizationService>, 
    IOrganizationService
Public Class OrganizationServiceProxy
    Inherits ServiceProxy(Of IOrganizationService)
    Implements IOrganizationService

Constructors

Name Description
System_CAPS_pubmethod OrganizationServiceProxy(IServiceConfiguration<IOrganizationService>, ClientCredentials)

Initializes a new instance of the OrganizationServiceProxy class using a service configuration and client credentials.

System_CAPS_pubmethod OrganizationServiceProxy(IServiceConfiguration<IOrganizationService>, SecurityTokenResponse)

Initializes a new instance of the OrganizationServiceProxy class using a service configuration and a security token response.

System_CAPS_pubmethod OrganizationServiceProxy(IServiceManagement<IOrganizationService>, ClientCredentials)

Initializes a new instance of the OrganizationServiceProxy class using a service configuration and client credentials.

System_CAPS_pubmethod OrganizationServiceProxy(IServiceManagement<IOrganizationService>, SecurityTokenResponse)

Initializes a new instance of the OrganizationServiceProxy class using a service management and a security token response.

System_CAPS_pubmethod OrganizationServiceProxy(Uri, Uri, ClientCredentials, ClientCredentials)

Initializes a new instance of the OrganizationServiceProxy class using a organization service URI, home realm URI, and client and device credentials.

Properties

Name Description
System_CAPS_pubproperty CallerId

Gets or sets the ID of the user for whom SDK calls are made on behalf of.

System_CAPS_pubproperty CallerRegardingObjectId

System_CAPS_protproperty ChannelFactory

Gets a WCF channel factory that manages a single channel instance.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty ClientCredentials

Gets the login credentials of the client.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty DeviceCredentials

Gets the Windows Live credentials of a registered device.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty EndpointAutoSwitchEnabled

Gets or sets a value that enables automatic switching from the organization’s current endpoint to an alternate endpoint.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty EndpointSwitch

Gets the endpoint switch information from the web service configuration.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty HomeRealmSecurityTokenResponse

Gets the security token response of the home realm.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty HomeRealmUri

Gets the home realm URI.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty IsAuthenticated

Gets a value indicating if the WCF channel has been authenticated.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty SdkClientVersion

Gets or sets the version of the client.

System_CAPS_pubproperty SecurityTokenResponse

Gets the security token response.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty ServiceChannel

Gets the communication channel used to access a Microsoft Dynamics 365 service.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty ServiceConfiguration

Gets a service configuration.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty ServiceManagement

Gets a service management.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty SyncOperationType

For internal use only.

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.(Inherited from ServiceProxy<TService>.)

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.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubproperty UserType

Methods

Name Description
System_CAPS_pubmethod Associate(String, Guid, Relationship, EntityReferenceCollection)

Creates a link between records.

System_CAPS_protmethod AssociateCore(String, Guid, Relationship, EntityReferenceCollection)

For internal use only.

System_CAPS_pubmethod Authenticate()

Closes the service channel and channel factory if they are open, and then invokes AuthenticateCore.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod AuthenticateCore()

Authenticates the client with a service.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod AuthenticateCrossRealm()

Invokes AuthenticateCrossRealmCore.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod AuthenticateCrossRealmCore()

Authenticates a user in a realm other than the realm that the Microsoft Dynamics 365 server is located in.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod AuthenticateDevice()

Invokes AuthenticateDeviceCore.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod AuthenticateDeviceCore()

Authenticates a device with Windows Live.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod CloseChannel(Boolean)

Closes a validated service channel.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod Create(Entity)

Creates a record.

System_CAPS_protmethod CreateCore(Entity)

For internal use only.

System_CAPS_pubmethod Delete(String, Guid)

Deletes a record.

System_CAPS_protmethod DeleteCore(String, Guid)

For internal use only.

System_CAPS_pubmethod Disassociate(String, Guid, Relationship, EntityReferenceCollection)

Deletes a link between records.

System_CAPS_protmethod DisassociateCore(String, Guid, Relationship, EntityReferenceCollection)

For internal use only.

System_CAPS_pubmethod Dispose()

Custom implementation of Dispose that disposes the service channel and channel factory.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod Dispose(Boolean)

Custom implementation of Dispose that disposes the service channel and channel factory.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod EnableProxyTypes()

Enables support for the early-bound entity types.

System_CAPS_pubmethod EnableProxyTypes(Assembly)

Enables support for the early-bound entity types exposed in a specified assembly.

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_pubmethod Execute(OrganizationRequest)

Executes a message in the form of a request, and returns a response.

System_CAPS_protmethod ExecuteCore(OrganizationRequest)

For internal use only.

System_CAPS_protmethod Finalize()

Implicitly frees allocated service channel and service factory resources.(Inherited from ServiceProxy<TService>.)

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.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod HandleFailover(Nullable<Boolean>)

For internal use only.(Inherited from ServiceProxy<TService>.)

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.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod OnFactoryFaulted(ChannelFaultedEventArgs)

Event handler virtual method for a channel factory that is in a faulted state.(Inherited from ServiceProxy<TService>.)

System_CAPS_protmethod OnFactoryOpened(ChannelEventArgs)

Event handler virtual method for a channel factory that is in an opened state.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod Retrieve(String, Guid, ColumnSet)

Retrieves a record.

System_CAPS_protmethod RetrieveCore(String, Guid, ColumnSet)

For internal use only.

System_CAPS_pubmethod RetrieveMultiple(QueryBase)

Retrieves a collection of records.

System_CAPS_protmethod RetrieveMultipleCore(QueryBase)

For internal use only.

System_CAPS_protmethod ShouldRetry(MessageSecurityException, Nullable<Boolean>)

Checks a message security exception to determine if a service call should be attempted again.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod SwitchToAlternateEndpoint()

Switches the organization’s current endpoint to an alternate endpoint, if one is available.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod Update(Entity)

Updates an existing record.

System_CAPS_protmethod UpdateCore(Entity)

For internal use only.

System_CAPS_protmethod ValidateAuthentication()

Authenticates the client and creates a new service channel.(Inherited from ServiceProxy<TService>.)

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.(Inherited from ServiceProxy<TService>.)

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.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubevent FactoryClosed

Occurs when a channel factory is closed. (Inherited from ServiceProxy<TService>.)

System_CAPS_pubevent FactoryFaulted

Occurs when a channel factory is faulted.(Inherited from ServiceProxy<TService>.)

System_CAPS_pubevent FactoryOpened

Occurs when a channel factory is opened.(Inherited from ServiceProxy<TService>.)

Remarks

To call the Microsoft Dynamics 365 web service using the IOrganizationService interface, cast the proxy instance to an IOrganizationService type.

Important

This class is not thread safe. Microsoft Dynamics 365 (online) authentication using the Microsoft Online Services environment identity provider, including Microsoft Office 365, is supported.

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
Sample: Authenticate users with Microsoft Dynamics 365 web services
Troubleshooting and error handling
Use the Organization Service to read and write data or metadata

Return to top

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright