This documentation is archived and is not being maintained.

ImportCompressedAllXml Message (CrmService)

Dynamics
banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment typesWorks online only

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

The relevant classes are specified in the following table.

TypeClass
RequestImportCompressedAllXmlRequest
ResponseImportCompressedAllXmlResponse

Remarks

To use this message, pass an instance of the ImportCompressedAllXmlRequest class as the request parameter in the Execute method.

For a list of required privileges, see ImportCompressedAllXml Privileges.

Example

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://<servername>:<port>/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);
[Visual Basic .NET]
' Set up the CRM service.
Dim token As 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";
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create the request.
Dim requestExport As New ExportCompressedAllXmlRequest()
requestExport.EmbeddedFileName = "customizations.xml"

' Execute the request.
Dim responseExport As ExportCompressedAllXmlResponse = CType(service.Execute(requestExport), ExportCompressedAllXmlResponse)

' Get the compressed data.
Dim compressedXML() As Byte = responseExport.ExportCompressedXml

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show: