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", "\"http://nintex.com/ProcessTaskResponse\"");

                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=""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>" + "<ProcessTaskResponse xmlns=\"http://nintex.com/\">";

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

                XmlDoc.LoadXml(test.ToLower());

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

Outcomes