Hi,
We have followed Nintex SDK to publish site workflows through the web service that provide Nintex Workflow with success, but now we need to schedule this workflow to execute it daily also programmatically. We have followed SDK and we have tried to do it with this code:
classProgram
{
privateconststring WFServiceUrl ="_vti_bin/nintexworkflow/workflow.asmx";
staticvoid Main(string[] args)
{
using (SPSite site =newSPSite("http://wingtipserver"))
{
using (SPWeb web = site.OpenWeb("/espais/espai1"))
{
string webServiceUrl = web.Url;
if (!webServiceUrl.EndsWith("/"))
webServiceUrl +="/";
webServiceUrl += WFServiceUrl;
NintexWS.NintexWorkflowWS service =new NintexWS.NintexWorkflowWS();
service.Url = webServiceUrl;
service.UseDefaultCredentials=true;
NintexWS.Schedule schedule =new NintexWS.Schedule();
NintexWS.RepeatInterval interval =new NintexWS.RepeatInterval();
interval.Type = NintexWS.RepeatIntervalType.Daily;
interval.CountBetweenIntervals=1;
schedule.StartTime =DateTime.Today.AddDays(1);
schedule.RepeatInterval = interval;
service.AddWorkflowSchedule("http://wingtipserver/espais/espai1", "Recopilador estadístiques",
"<startDataXml></startDataXml>", schedule, true);
}
}
}
}
But the problem is that the call to the “AddWorkflowSchedule” raise an exception and we have no idea why ({"Server was unable to process request. ---> Value does not fall within the expected range."}). We have try with an empty string in the startdata parameter with the same result.
Has anyone been successful scheduling a workflow programatically?
Thanks in advance,