public static DiscoverOrganizations ( IDiscoveryService service ) : OrganizationDetailCollection | ||
service | IDiscoveryService | A Discovery service proxy instance. |
Résultat | OrganizationDetailCollection |
private bool ValidateWebServiceConnection() { try { ServerConnection.DiscoverOrganizations(this.DiscoveryClient); } catch (Exception) { return(false); } return(true); }
public List <OrganizationDetail> GetAllOrganizations(Common.ValidationResult validationResult) { // Retrieve the list of all organizations List <OrganizationDetail> detail = new List <OrganizationDetail>(); try { detail = ServerConnection.DiscoverOrganizations(this.DiscoveryClient).ToList(); } catch (Exception ex) { if (validationResult != null) { validationResult.AddError(string.Format(CultureInfo.CurrentUICulture, Resources.RetrieveAllCompaniesExceptionMessage, ex.Message)); } } return(detail); }
// Retrieve a CRM object that can be used to get the various endpoints for calling the CRM web services private OrganizationDetail GetOrgExtDetail() { if (this.orgExtDetail == null) { // Retrieve the list of organizations that the logged on user belongs to. this.orgExtDetail = ServerConnection.FindOrganization(this.OrganizationName, ServerConnection.DiscoverOrganizations(this.DiscoveryClient).ToArray()); // Check whether a matching organization was not found. if (this.orgExtDetail == null) { throw new AdapterException(string.Format(CultureInfo.CurrentCulture, Resources.OrganizationNotFoundExceptionMessage, this.OrganizationName)) { ExceptionId = ErrorCodes.OrganizationNotFound }; } } return(this.orgExtDetail); }