locked
Compiler error when calling ValidateWorkflowMarkupAndCreateSupportObjects RRS feed

  • Question

  • Hi,

    I created a workflow in sharepoint designer then i exported xoml, xoml.rules, xoml.wfconfig.xml files from it.

    I want to deploy these files in sharepoint using a host application (Windows Forms application). So, I call ValidateWorkflowMarkupAndCreateSupportObjects and AssociateWorkflowMarkup method from the WebPartPagesWebService class.

    This is the code:

               
                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 return "Data at the root level is invalid. Line 1, position 1".

    And AssociateWorkflowMarkup throw Microsoft.SharePoint.SoapServer.SoapServerException.



    The Logs file:

    Name=Request (POST:http://acer-pc:21788/_vti_bin/Webpartpages.asmx)    3dccdc9b-af66-4f72-b41f-51a4d1774b35

    Site=/    3dccdc9b-af66-4f72-b41f-51a4d1774b35

    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 de 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)     à Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, ...    3dccdc9b-af66-4f72-b41f-51a4d1774b35 ...SPBasePermissions& permMask)     à 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.


    When i deploy the workflow using Sharepoint Designer it works. But i want to deploy it with a customized application in a first step then create my own workflow designer in second step.





    Monday, February 24, 2014 8:12 AM