How to launch a request with a FILE using SOAP Web Services


Configure the process

To send a file to a process, perform the following steps:

  1. Enable Sub-process mode for the process and set Access level to Public.

  2. Create a file data (such as REQUEST_FILE) and select IN or INOUT for Sub-process parameter.


Create a request with a file as parameter

With the WorkflowGen Web Service SOAP, you have to use the StartProcess method.

Use file path

The file you want to upload has to be accessible by WorkflowGen; it could be in a network folder.

Use XML context

        <fileDescription>My report</fileDescription>

In this example the file needs to be in C:\myfolder\ on the WorkflowGen server. If the file is not present, you will receive a File not found error.


You can try this context with the following URL: http://[YOUR_SITE]/wfgen/ws/processesruntime.asmx?op=StartProcess


Build the context with WorkflowGen.My

To simplify WorkflowContext creation and modification, you can use WorkflowGen.My and its WorkflowGen.My.Data.ContextParameters class.

To send a file you can use the FileInfo class.

WorkflowGen.My.Data.ContextParameters myWorkflowContextParameters = new WorkflowGen.My.Data.ContextParameters();

ContextFileReference cfr = new ContextFileReference();
FileInfo fi = new FileInfo(@"C:\myfolder\report.xls");
cfr.Name = fi.Name;
cfr.Description = fi.Name;
cfr.Path = fi.FullName;
cfr.OriginalPath = fi.FullName;
cfr.ContentType = "application/";
cfr.DateLastModified = fi.LastWriteTimeUtc;
cfr.Size = fi.Length;

WorkflowGen.My.Data.ContextParameter contextParam = new WorkflowGen.My.Data.ContextParameter();

contextParam.Name = "REQUEST_FILE";

contextParam.Direction = WorkflowGen.My.Data.ContextParameter.Directions.Out;

contextParam.Type = typeof(string);

contextParam.Value = cfr;



string workflowContext = myWorkflowContextParameters.GetXml();