Search

ImportCompressedAllXml Message

Import all customizations from an XML file that has been compressed using the WinZip format.



This request requires an ImportExportXml file for import. This example exports this file from CRM and then imports it back into Microsoft Dynamics CRM.
[C#]
// Set up the CRM service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0;
token.OrganizationName = "AdventureWorksCycle";

CrmService service = new CrmService();
service.Url = "http://:/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the request.
ExportCompressedAllXmlRequest requestExport = new ExportCompressedAllXmlRequest();
requestExport.EmbeddedFileName = "customizations.xml";

// Execute the request.
ExportCompressedAllXmlResponse responseExport = (ExportCompressedAllXmlResponse)service.Execute(requestExport);

// Get the compressed data
byte[] compressedXML = responseExport.ExportCompressedXml;

// Create the request.
ImportCompressedAllXmlRequest request = new ImportCompressedAllXmlRequest();

// Assign the compressed data
request.CompressedCustomizationXml = compressedXML;

// Execute the request.
ImportCompressedAllXmlResponse response = (ImportCompressedAllXmlResponse)service.Execute(request);