Hi All,
We need to Send Data from CRM and to Perform Submit Button Automatically with this data on External Application.
I have tried the same request call from Console Application its working fine.
Am working on Dynamics365 - Onpermises.
But it's not working in either Custom Action or Plugin. It's Crashing at GetRequestStream() when we try to Debug.
facing Issue in Custom Action . Code used in Custom Action like Below..
HttpWebResponse httpWebResponse = null;
Stream requestStream = null;
Stream responseStream = null;
var req = (HttpWebRequest)WebRequest.Create("http://xxxxx/form.do");
var postData = "agnCI=8";
postData += "&agnFN=DOI-2-Save";
postData += "&agnSUBSCRIBE=1";
var data = Encoding.ASCII.GetBytes(postData);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = data.Length;
requestStream = req.GetRequestStream();
requestStream.Write(data, 0, data.Length);
requestStream.Close();
httpWebResponse = (HttpWebResponse)req.GetResponse();
var responseString = new StreamReader(httpWebResponse.GetResponseStream()).ReadToEnd();
Can anyone help on my request?
Thanks,
Shiva K
*This post is locked for comments