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", "");

                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="""" xmlns:xsd="""" xmlns:soap="""">" + "<soap:Body>" + "<GetRunningWorkflowTasksForCurrentUserForListItem xmlns=\"\">";

                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();


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