AnsweredAssumed Answered

Use Nintex Workflow Web Service to Visual Studio Based List

Question asked by hardik_dalia on Feb 13, 2015

I have created a sharepoint list using Visual Studio 2012 and also created Request Approval Workflow

As in Infopath it returns value,


But when I am trying to call a web service( _vti_bin/NintexWorkflow/workflow.asmx)


This is my code and I am getting error (Internal Server Error 500)


here is my code,


WebClient wb = new WebClient();

                wb.Credentials = new NetworkCredential("username", "password");

                wb.Headers.Add("SOAPAction", "\"\"");

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

                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>" + "<ProcessTaskResponse xmlns=\"\">";

                input = "<outcome>" + "Approved" + "</outcome>" + "<spTaskId>" + 14(int)+ "</spTaskId>" + "</ProcessTaskResponse></soap:Body></soap:Envelope>";

                xml = payload + input;

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

               // wb.Credentials = CredentialCache.DefaultCredentials;

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

                test = Encoding.Default.GetString(result);

                XmlDocument XmlDoc = new XmlDocument();


                string response = XmlDoc.GetElementsByTagName("ProcessTaskResponse2Result").Item(0).InnerText;