CreateProcInst : The remote server returned an error: (400) Bad Request.
Hi Team,
I am getting "The remote server returned an error: (400) Bad Request." with Status : "ProtocolError" while creating process using the below code.
-
Hi Prakash,
Try the below code.
public static string CreateProcInstEx(string PID, string PIID, string PIName, string workObjectID,
string superPIID, string initiator, string customID, IEnumerable<NameValue> attributes, bool startImmediately)
{
string url = $"{WebConfig.AppSettings[$"{WFConst.constAdminSettings}:{WFConst.constWorkflowUrl}"]}CreateProcInst";
#region Json Object
dynamic jsonRequestData = new ExpandoObject();
jsonRequestData.ProcessID = PID;
jsonRequestData.ProcessInstID = PIID;
jsonRequestData.ProcInstName = PIName;
jsonRequestData.WorkObjID = workObjectID;
jsonRequestData.WorkObjInfo = "";
jsonRequestData.SuperProcInstID = superPIID ?? "";
jsonRequestData.Initiator = initiator;
jsonRequestData.CustomID = customID;
jsonRequestData.Attributes = attributes.ToArray();
jsonRequestData.blnStartImmediately = startImmediately;
#endregion
string _jsonString = JsonConvert.SerializeObject(jsonRequestData);
HTTPOperations ops = new HTTPOperations(domain, this.userName,password, appID, locale);
string respose = ops.POSTMethod(url, _jsonString);
string eventID = null;
}
Modification: The parameter attributes should be in array, but in that code attributes are sent as string .
Thanks,
Venkat
Please sign in to leave a comment.
Comments
1 comment