我已经能够从导入XML文件实体到使用ImportXmlRequest我的动态情况如下:导入工作流使用MetadataService或CrmService
// Create the import request
ImportXmlRequest importRequest = new ImportXmlRequest {
ParameterXml [email protected]"<entities><entity>MyFirstEntity<entity>MySecondEntity</entities><nodes/><securityroles/><settings/><workflows/></importexportxml>" };string customizationPath = "entityCustomizations.xml";
// Pass the stream of customization XML to the import request using
(StreamReader sr = new StreamReader(customizationPath)) {
string customizationXml = sr.ReadToEnd();
importRequest.CustomizationXml = customizationXml; }// Import the customizations myCrmService.Execute(importRequest);
这工作正常。
我还需要从XML文件导入工作流到我的Dynamics实例。我尝试使用相同的方法,但我不断收到以下错误:'0x80040216无法识别的格式'。
我可以通过将包含工作流的XML文件添加到ZIP文件,然后使用ImportCompressedAllXmlRequest导入ZIP文件来获得它。
是ImportCompressedAllXmlRequest导入工作流程的唯一方法,还是我缺少显式的ImportXmlRequest?
感谢,
大卫