ImportAllXml Message (CrmService)
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
| Works for all deployment types | Works online only |
Import all customizations from an XML file.
The relevant classes are specified in the following table.
| Type | Class |
| Request | ImportAllXmlRequest |
| Response | ImportAllXmlResponse |
Remarks
To use this message, pass an instance of the ImportAllXmlRequest class as the request parameter in the Execute method.
For a list of required privileges, see ImportAllXml 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;
// This is a potentially long running operation. The default 90-second
// time-out might be too short. Set the time-out to be 5 minutes.
// This property takes milliseconds.
service.Timeout = 300 * 1000;
// Create the request.
ExportAllXmlRequest request = new ExportAllXmlRequest();
// Execute the request.
ExportAllXmlResponse exportResponse = (ExportAllXmlResponse)service.Execute((Request)request);
// Create the request.
ImportAllXmlRequest importRequest = new ImportAllXmlRequest();
// Tell the request where the temporary XML file is located.
importRequest.CustomizationXml = exportResponse.ExportXml;
// Execute the import.
ImportAllXmlResponse importResponse = (ImportAllXmlResponse)service.Execute(importRequest);
[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
' This is a potentially long running operation. The default 90-second
' time-out may be too short. Set the time-out to be 5 minutes.
' This property takes milliseconds.
service.Timeout = 300 * 1000
' Create the request.
Dim request As New ExportAllXmlRequest()
' Execute the request.
Dim exportResponse As ExportAllXmlResponse = CType(service.Execute(CType(request, Request)), ExportAllXmlResponse)
' Create the request.
Dim importRequest As New ImportAllXmlRequest()
' Tell the request where the temporary xml file is located.
importRequest.CustomizationXml = exportResponse.ExportXml
' Execute the import.
Dim importResponse As ImportAllXmlResponse = CType(service.Execute(importRequest), ImportAllXmlResponse)
See Also
Concepts
Reference
.gif)