Export (0) Print
Expand All
Expand Minimize

ExportXml Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Export the specified set of entity customizations to an XML file.

The relevant classes are specified in the following table.

TypeClass
RequestExportXmlRequest
ResponseExportXmlResponse

Remarks

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

For a list of required privileges, see ExportXml Privileges.

Example

The following sample code shows how to use the ExportXml message.

[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.
ExportXmlRequest exportRequest = new ExportXmlRequest();

// Define the entities to retrieve, in this case accounts and contacts.
// The XML format must match this and the empty "nodes" node is required.
exportRequest.ParameterXml = @"<importexportxml>
<entities>
   <entity>account</entity>
</entities>
<nodes>  
   <node>templates</node> 
</nodes>
<securityroles/>    
<settings>
   <setting>marketing</setting>
</settings>
<workflows/>
</importexportxml>";

// Execute the request.
ExportXmlResponse entities = (ExportXmlResponse)service.Execute(exportRequest);
[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 exportRequest As New ExportXmlRequest()

' Define the entities to retrieve, in this case accounts and contacts.
' The XML format must match this and the empty "nodes" node is required.
exportRequest.ParameterXml = _
"<importexportxml>" + _
"<entities>" + _
   "<entity>account</entity>" + _
   "<entity>contact</entity>" + _
"</entities>" + _
"<nodes>" + _
   "<node>templates</node>" + _ 
"</nodes>" + _
"<securityroles/>" + _                       _
"<settings>" + _
   "<setting>marketing</setting>" + _
"</settings>" + _
"<workflows/> + _
"</importexportxml>"

' Execute the request.
Dim entities As ExportXmlResponse = CType(service.Execute(exportRequest), ExportXmlResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft