Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sharepoint 调用ValidateWorkflowMarkupAndCreateSupportObjects时出错_Sharepoint_Sharepoint Workflow - Fatal编程技术网

Sharepoint 调用ValidateWorkflowMarkupAndCreateSupportObjects时出错

Sharepoint 调用ValidateWorkflowMarkupAndCreateSupportObjects时出错,sharepoint,sharepoint-workflow,Sharepoint,Sharepoint Workflow,我在sharepoint designer中创建了一个工作流,然后从中导出了xoml、xoml.rules、xoml.wfconfig.xml文件 我想使用主机应用程序(Windows窗体应用程序)在sharepoint中部署这些文件。因此,我从WebPartPagesWebService类调用ValidateWorkflowMarkup和CreateSupportObjects和AssociateWorkflowMarkup方法。 代码如下: string XomlFile = @"D:\wk

我在sharepoint designer中创建了一个工作流,然后从中导出了xoml、xoml.rules、xoml.wfconfig.xml文件

我想使用主机应用程序(Windows窗体应用程序)在sharepoint中部署这些文件。因此,我从
WebPartPagesWebService
类调用
ValidateWorkflowMarkup和CreateSupportObjects
AssociateWorkflowMarkup
方法。 代码如下:

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
返回“
根级别的数据无效。第1行,位置1

AssociateWorkflowMarkup
抛出
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.

传入文件名,但该方法需要实际的XML。(扪心自问:您正在调用一个web服务,通常是远程调用,那么服务器如何从本地PC驱动器读取任何文件?)阅读MSDN文档;但是,请注意,该标签并不十分清楚,您必须查看。

请不要重复问题标题中的标签。谢谢
ValidateWorkflowMarkupAndCreateSupportObjects
立即返回
“”
。但会引发相同的异常。我通过
service.AssociateWorkflowMarkup(“Workflows/rami workflow designer/rami workflow designer.xoml.wfconfig.xml”,“V1.0”)修改了代码中的最后一行
但它并没有解决问题。@RamiNeji我正在做类似的事情,并以与发布*.wfconfig.xml时相同的方式坚持。如果您已解决此问题,请发布解决方案。