We have a new webservice in CRM 4.0 i.e. CrmDeploymentService
This is the end-point for this web service
http://<servername%5B:port%5D>/mscrmservices/2007/crmdeploymentservice.asmx
Using CrmDeploymentService we can do the following
Create/Delete/Disable/Enable/Update/Set Default an organization etc.
There are two types of Microsoft Dynamics CRM deployment entities: Organization and Server. The Deployment SDK provides programmatic access for manipulating the Organization entity. It does not currently enable you to write code against the Server entity for actions such as enabling and disabling a Microsoft Dynamics CRM server.
We have a separate sdk for the Deployement.
We can download the sdk at the following location
Some basic examples of using the service
// Create an instance of CrmDeploymentService
CrmDeploymentService myDeployService = new CrmDeploymentService();
myDeployService.Credentials = System.Net.CredentialCache.DefaultCredentials;
myDeployService.Url = ” valid url”;
// To retrieve server license type information
RetrieveLicenseRequest myLicRequest = new RetrieveLicenseRequest();
RetrieveLicenseResponse myLicResponse = (RetrieveLicenseResponse)myDeployService.Execute(myLicRequest);
MessageBox.Show(“License Type “ + myLicResponse.LicenseType.ToString());
// To get the organization information
RetrieveAllRequest myRetriveAllRequest = new RetrieveAllRequest();
// only organization is supported ( other is Server)
myRetriveAllRequest.EntityName = EntityName.Organization;
RetrieveAllResponse myRetriveAllResponse = (RetrieveAllResponse)myDeployService.Execute(myRetriveAllRequest);
foreach(DeploymentEntity myEntity in myRetriveAllResponse.Entities)
{
Organization myOrganization = (Organization)myEntity;
MessageBox.Show(myOrganization.FriendlyName);
MessageBox.Show(myOrganization.Id.ToString());
MessageBox.Show(myOrganization.UniqueName);
}
//// To disable an organization
SetStateOrganizationRequest myOrgSetStateRequest = new SetStateOrganizationRequest();
myOrgSetStateRequest.EntityName = EntityName.Organization;
myOrgSetStateRequest.Id = new Guid(“4c7fc991-0a41-dd11-bfd9-001d7d22e1af”);
myOrgSetStateRequest.State = OrganizationState.Disabled;
SetStateOrganizationResponse myOrgSetStateResponse =(SetStateOrganizationResponse) myDeployService.Execute(myOrgSetStateRequest);
Bye …..
One thought on “Using CrmDeploymentService CRM 4.0”