Export (0) Print
Expand All
Expand Minimize

ExportCompressedXml Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Export the specified customizations to an XML file, which is then compressed using the WinZip format.

The relevant classes are specified in the following table.

TypeClass
RequestExportCompressedXmlRequest
ResponseExportCompressedXmlResponse

Remarks

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

For a list of required privileges, see ExportCompressedXml Privileges.

Example

[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 an ExportCompressedXml request.
ExportCompressedXmlRequest request = new ExportCompressedXmlRequest();

// Set the filename of the xml file that will be in the zip file.
request.EmbeddedFileName = "Customizations.xml";

// Set the ParameterXml, which defines what cusomization to export.
request.ParameterXml =
    @"<importexportxml>
        <entities>
            <entity>account</entity>   
        </entities>
        <nodes/>
        <securityroles/>
        <workflows/>
        <settings/>
    </importexportxml>";

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

// Save the exported zip file.
System.IO.File.WriteAllBytes(@"Exported_Customization.zip", response.ExportCompressedXml);
[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 an ExportCompressedXml request.
Dim request As New ExportCompressedXmlRequest()

' Set the filename of the xml file that will be in the zip file.
request.EmbeddedFileName = "Customizations.xml"

' Set the ParameterXml which defines what cusomization to export.
request.ParameterXml = "<importexportxml>" & ControlChars.CrLf & "<entities>" & ControlChars.CrLf & "<entity>account</entity>   " & ControlChars.CrLf & "</entities>" & ControlChars.CrLf & "<nodes></nodes>" & ControlChars.CrLf & "<securityroles></securityroles>" & ControlChars.CrLf & "<workflows></workflows>" & ControlChars.CrLf & "<settings></settings>" & ControlChars.CrLf & "</importexportxml>"

' Execute the request.
Dim response As ExportCompressedXmlResponse = CType(service.Execute(request), ExportCompressedXmlResponse)

' Save the exported zip file.
System.IO.File.WriteAllBytes("Exported_Customization.zip", response.ExportCompressedXml)

See Also

Concepts

Reference

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft