Exemplo n.º 1
0
 /// <summary>Initializes a new instance of the  <see cref="T:Microsoft.Xrm.Sdk.Client.ServiceProxy`1"></see> class using a service URI, a home realm URI, client logon credentials, and pn_Windows_Live device credentials.</summary>
 /// <param name="deviceCredentials">Type: Returns_ClientCredentials. The credentials of a device registered with pn_Windows_Live. Only required when authenticating with pn_CRM_Online, otherwise use null.</param>
 /// <param name="homeRealmUri">Type: Returns_URI. The URI of the WS-Trust metadata endpoint of a second ADFS instance.</param>
 /// <param name="uri">Type: Returns_URI. The URI of the service.</param>
 /// <param name="clientCredentials">Type: Returns_ClientCredentials. The client’s logon credentials.</param>
 protected ServiceProxy(
     Uri uri,
     Uri homeRealmUri,
     ClientCredentials clientCredentials,
     ClientCredentials deviceCredentials)
 {
     ClientExceptionHelper.ThrowIfNull((object)uri, nameof(uri));
     this.IsAuthenticated      = false;
     this.ServiceConfiguration = ServiceConfigurationFactory.CreateConfiguration <TService>(uri);
     this.SetClientCredentials(clientCredentials);
     this.HomeRealmUri = homeRealmUri;
     //this.DeviceCredentials = deviceCredentials;
     //this.SetDefaultEndpointSwitchBehavior();
 }
 /// <summary>Creates a service management.</summary>
 /// <returns>Type:  <see cref="T:Microsoft.Xrm.Sdk.Client.IServiceManagement`1"></see>A service management object.</returns>
 /// <param name="serviceUri">Specifies the service’s URI.</param>
 public static IServiceManagement <TService> CreateManagement <TService>(
     Uri serviceUri)
 {
     return(ServiceConfigurationFactory.CreateManagement <TService>(serviceUri, false, (Assembly)null));
 }