我在sharepoint designer中創建了一個工作流程,然後我從中導出了xoml,xoml.rules,xoml.wfconfig.xml文件。錯誤當調用ValidateWorkflowMarkupAndCreateSupportObjects
我想使用主機應用程序(Windows窗體應用程序)在SharePoint中部署這些文件。所以,我從WebPartPagesWebService
類調用ValidateWorkflowMarkupAndCreateSupportObjects
和方法。 下面的代碼:
string XomlFile = @"D:\wkf\rami workflow designer.xoml";
string RulesFile = @"D:\wkf\rami workflow designer.xoml.rules";
string ConfigFile = @"D:\wkf\rami workflow designer.xoml.wfconfig.xml";
string flag = "2";
websvcWebPartPages.WebPartPagesWebService service = new websvcWebPartPages.WebPartPagesWebService();
service.UseDefaultCredentials = true;
service.PreAuthenticate = true;
string result = service.ValidateWorkflowMarkupAndCreateSupportObjects(XomlFile, RulesFile, ConfigFile, flag);
service.AssociateWorkflowMarkup(ConfigFile, "V1.0");
ValidateWorkflowMarkupAndCreateSupportObjects
回報 「Data at the root level is invalid. Line 1, position 1
」。
andthrows Microsoft.SharePoint.SoapServer.SoapServerException
。
的日誌文件:
Unknown SPRequest error occurred. More information: 0x80070002 3dccdc9b-af66-4f72-b41f-51a4d1774b35
SOAP exception: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception of HRESULT : 0x80070002)
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAndFolderProperties(String bstrUrl, String bstrStartUrl, ListDocsFlags ListDocsFlags, Boolean bThrowException, Int32& phrStatus, Object& pvarFiles, Object& pvarDirs, UInt32& pdwNumberOfFiles, UInt32& pdwNumberOfDirs)
at Microsoft.SharePoint.Library.SPRequest.GetFileAndFolderProperties(String bstrUrl, String bstrStartUrl, ListDocsFlags ListDocsFlags, Boolean bThrowException, Int32& phrStatus, Object& pvarFiles, Object& pvarDirs, UInt32& pdwNumberOfFiles, UInt32& pdwNumberOfDirs)
at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, ... 3dccdc9b-af66-4f72-b41f-51a4d1774b35 ...SPBasePermissions& permMask)
at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean throwException)
at Microsoft.SharePoint.Workflow.SPWorkflowNoCodeSupport.LoadWorkflowBytesElevated(SPFile file, Int32 fileVer, Int32& userid, DateTime& lastModified)
at Microsoft.SharePoint.Workflow.SPWorkflowNoCodeSupport.LoadWorkflowBytes(SPFile file, Int32 fileVer, Int32& userid)
at Microsoft.SharePoint.SoapServer.WebPartPagesWebService.AssociateWorkflowMarkup(String configUrl, String configVersion) 3dccdc9b-af66-4f72-b41f-51a4d1774b35.
請勿在問題標題中重複標籤。 –