private void ReplaceWSSecurityHeader_Click(object sender, RoutedEventArgs e) { string txtBoxBodyContent = RequestBodyUCValueExpression.ValueTextBox.Text; List <string> SoapSecurityContent = HttpWebClientUtils.GetSoapSecurityHeaderContent(ref txtBoxBodyContent); RequestBodyUCValueExpression.ValueTextBox.Text = txtBoxBodyContent; if (string.IsNullOrEmpty(txtBoxBodyContent)) { return; } for (int i = 1; i < SoapSecurityContent.Count; i++) { if (mAct.DynamicElements.Count == 0) { mAct.DynamicElements.Add(new ActInputValue() { Param = SoapSecurityContent.ElementAt(i) }); } else { if (mAct.DynamicElements.Where(x => x.Param.Equals(SoapSecurityContent.ElementAt(i))).Count() == 0) { mAct.DynamicElements.Add(new ActInputValue() { Param = SoapSecurityContent.ElementAt(i) }); } } } }
private void HandleWebApiRequest(ActWebAPIBase act) { HttpWebClientUtils WebAPI = new HttpWebClientUtils(); //Call for Request Construction if (WebAPI.RequestContstructor(act, WebServicesProxy)) { WebAPI.SaveRequest(SaveRequestXML, SavedXMLDirectoryPath); Reporter.ToLog(eLogLevel.INFO, "RequestContstructor passed successfully", null, true, true); if (WebAPI.SendRequest() == true) { Reporter.ToLog(eLogLevel.INFO, "SendRequest passed successfully", null, true, true); //Call for response validation bool dontFailActionOnBadResponse = false; Boolean.TryParse(act.GetInputParamCalculatedValue(ActWebAPIBase.Fields.DoNotFailActionOnBadRespose), out dontFailActionOnBadResponse); if (!dontFailActionOnBadResponse) { WebAPI.ValidateResponse(); } Reporter.ToLog(eLogLevel.INFO, "ValidateResponse passed successfully", null, true, true); WebAPI.SaveResponseToFile(SaveResponseXML, SavedXMLDirectoryPath); WebAPI.HandlePostExecutionOperations(); //Parse response WebAPI.ParseRespondToOutputParams(); Reporter.ToLog(eLogLevel.INFO, "ParseRespondToOutputParams passed successfully", null, true, true); } } }