PublishXml Message (CrmService)
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
| Works for all deployment types | Works online only |
Publish the customizations for the specified entities.
The relevant classes are specified in the following table.
| Type | Class |
| Request | PublishXmlRequest |
| Response | PublishXmlResponse |
Remarks
To use this message, pass an instance of the PublishXmlRequest class as the request parameter in the Execute method.
For a list of required privileges, see PublishXml Privileges.
Example
The following code example shows how to use the PublishXml 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.
PublishXmlRequest request = new PublishXmlRequest();
request.ParameterXml = @"<importexportxml>
<entities>
<entity>account</entity>
<entity>contact</entity>
</entities>
<nodes/>
<securityroles/>
<settings/>
<workflows/>
</importexportxml>";
// Execute the request.
PublishXmlResponse response = (PublishXmlResponse)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 request As New PublishXmlRequest()
request.ParameterXml = _
"<importexportxml>" + _
"<entities>" + _
"<entity>account</entity>" + _
"<entity>contact</entity>" + _
"</entities>" + _
"<nodes/>" + _
"<securityroles/>" + _
"<settings/>" + _
"<workflows/>" + _
"</importexportxml>"
' Execute the request.
Dim response As PublishXmlResponse = CType(service.Execute(request), PublishXmlResponse)
See Also
Concepts
Reference
© 2010 Microsoft Corporation. All rights reserved.
