Пример #1
0
        void DeserializeWithFormatPlugin(object PluginNameObject)
        {
            string PluginName = PluginNameObject.ToString();

            try
            {
                Request      Req = DisplayedRequest.GetClone(true);
                FormatPlugin FP  = FormatPlugin.Get(PluginName);
                CurrentFormatXml         = FP.ToXmlFromRequest(Req);
                CurrentXmlNameValueArray = FormatPlugin.XmlToArray(CurrentFormatXml);
                ShowStatusMsg("");
                SetDeserializedDataInUi(PluginName, CurrentFormatXml, CurrentXmlNameValueArray);
                this.ResetBodyParametersChangedStatus();
                ShowProgressBar(false);
            }
            catch (ThreadAbortException)
            {
                ShowStatusMsg("");
            }
            catch (Exception Exp)
            {
                IronException.Report(string.Format("Error converting Request to {0}", PluginName), Exp);
                ShowErrorMsg(string.Format("Unable to parse Request body as {0}", PluginName));
                ShowProgressBar(false);
            }
        }
Пример #2
0
        void AutoDetectFormatAndSetBodyParameters(object ReqObj)
        {
            try
            {
                Request Req    = ((Request)ReqObj).GetClone();
                string  FPName = FormatPlugin.Get(Req);

                if (FPName == "Normal")
                {
                    SetBodyParameters(Req, true);
                }
                else if (FPName.Length == 0)
                {
                    SetBodyParameters(Req, false);
                }
                else
                {
                    try
                    {
                        FormatPlugin FP = FormatPlugin.Get(FPName);
                        CurrentFormatXml         = FP.ToXmlFromRequest(Req);
                        CurrentXmlNameValueArray = FormatPlugin.XmlToArray(CurrentFormatXml);
                        SetDeserializedDataInUi(FP.Name, CurrentFormatXml, CurrentXmlNameValueArray);
                    }
                    catch
                    {
                        SetBodyParameters(Req, false);
                    }
                }
                this.ResetBodyParametersChangedStatus();
            }
            catch (ThreadAbortException) { }
            finally
            {
                ShowStatusMsg("");
                ShowProgressBar(false);
            }
        }
Пример #3
0
        internal static void DeSerializeRequestBody(object BFPObject)
        {
            string PluginName = "";

            try
            {
                BodyFormatParamters BFP     = (BodyFormatParamters)BFPObject;
                Request             Request = BFP.Request;
                FormatPlugin        Plugin  = BFP.Plugin;
                PluginName = Plugin.Name;

                string XML = Plugin.ToXmlFromRequest(Request);
                IronUI.FillMTRequestFormatXML(XML);
            }
            catch (ThreadAbortException)
            {
                //
            }
            catch (Exception Exp)
            {
                IronException.Report("Error Deserializing 'Manual Testing' Request using Format Plugin - " + PluginName, Exp.Message, Exp.StackTrace);
                IronUI.ShowMTException("Error Deserializing");
            }
        }