Export (0) Print
Expand All
Expand Minimize

ExportCompressedTranslationsXml Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Export all translations to an XML Microsoft Excel worksheet, which is then compressed using the WinZip format.

The relevant classes are specified in the following table.

TypeClass
RequestExportCompressedTranslationsXmlRequest
ResponseExportCompressedTranslationsXmlResponse

Remarks

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

For a list of required privileges, see ExportCompressedTranslationsXml Privileges.

Example

The following code sample shows how to use the ExportCompressedTranslationsXml 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.
ExportCompressedTranslationsXmlRequest request = new ExportCompressedTranslationsXmlRequest();

// Assign the file name
request.EmbeddedFileName = "translations.xml";

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

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

// Write the data to disk.
using (FileStream fs = new FileStream(@"C:\Translations.zip", FileMode.Create))
{
fs.Write(compressedXML, 0, compressedXML.Length);
fs.Close();

}
[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 request As New ExportCompressedTranslationsXmlRequest()

' Assign the file name
request.EmbeddedFileName = "translations.xml"

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

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

' Get the current directory path.
Dim currentDirectoryPath As String = System.IO.Directory.GetCurrentDirectory()

' Write it out to disk
Using fs As New FileStream(currentDirectoryPath & "\Translations.zip", FileMode.Create)
    fs.Write(compressedXML, 0, compressedXML.Length)
    fs.Close()
End Using

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft