AnsweredAssumed Answered

How does Nintex Workflow get the SharePoint List?

Question asked by hardik_dalia on Feb 16, 2015
Latest reply on Feb 17, 2015 by hardik_dalia

I am trying to get the SharePointTaskId from GetRunningWorkflowTasksForCurrentUserForListItem,

 

But However I am getting Error, (500 Internal Server Error)

 

I tried using Fiddler, It gives me this error.

 

<faultstring>Server was unable to process request. ---> System.ArgumentOutOfRangeException: Cannot find list. Parameter name: listName at Nintex.Workflow.Common.WebServiceHelper.GetList(String listName, SPWeb web) at NintexWorkflowWS.GetRunningWorkflowTasksForCurrentUserForListItem(Int32 itemId, String listName)</faultstring>

 

Here's my code:

              

                int SharePointTaskId;

                WebClient wb = new WebClient();

                wb.Headers.Add("SOAPAction", "http://nintex.com/GetRunningWorkflowTasksForCurrentUserForListItem");

                wb.Headers.Add("Content-Type", "text/xml; charset=utf-8");

                wb.Headers.Add("Content-Length", "length");

                // wb.Headers.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)");              

                var xml = string.Empty;

                var input = string.Empty;

                var payload = string.Empty;

                payload = @"<?xml version=""1.0"" encoding=""utf-8""?><soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" + "<soap:Body>" + "<GetRunningWorkflowTasksForCurrentUserForListItem xmlns=\"http://nintex.com/\">";

                input = "<itemId>" + 1 + "</itemId>" + "<listName>" + demoList + "</listName>" + "</GetRunningWorkflowTasksForCurrentUserForListItem></soap:Body></soap:Envelope>";

                xml = payload + input;

                var data = Encoding.UTF8.GetBytes(xml);

                var result = wb.UploadData("http://win8r2sp10/_vti_bin/nintexworkflow/workflow.asmx", data);

                test = Encoding.Default.GetString(result);

                XmlDocument XmlDoc = new XmlDocument();

                XmlDoc.LoadXml(test.ToLower());

                SharePointTaskId = Convert.ToInt32(XmlDoc.GetElementsByTagName("SharePointTaskId").Item(0).InnerText);

Outcomes