/// <summary>
        /// Creates a new web request.
        /// </summary>
        /// <param name="httpRequestType"> The HTTP request type.</param>
        /// <param name="url"> The url.</param>
        /// <returns> A new web request.</returns>
        public static WebRequest Create(HttpRequestType httpRequestType, string url)
        {
            WebRequest request = null;

            switch ( httpRequestType )
            {
                case HttpRequestType.GET:
                    request = new GetWebRequest();
                    request.Url = url;
                    break;
                case HttpRequestType.POST:
                    request = new PostWebRequest();
                    request.Url = url;
                    break;
                case HttpRequestType.PUT:
                    request = new PutWebRequest();
                    request.Url = url;
                    break;
                case HttpRequestType.DELETE:
                    request = new DeleteWebRequest();
                    request.Url = url;
                    break;
                case HttpRequestType.SOAPHTTP:
                    request = new SoapHttpWebRequest();
                    request.Url = url;
                    break;
            }

            return request;
        }
        /// <summary>
        /// Loads an exising Session type.
        /// </summary>
        /// <param name="session"> Loads a session type in the ScriptingDataDesigner.</param>
        public void LoadSession(Session session)
        {
            ScriptingApplication sd = new ScriptingApplication();

            foreach (SessionRequest req in session.SessionRequests )
            {
                if ( req.RequestType == HttpRequestType.GET )
                {
                    GetWebRequest getRequest = new GetWebRequest((GetSessionRequest)req);
                    sd.AddWebRequest(getRequest);
                }
                else if ( req.RequestType == HttpRequestType.POST )
                {
                    PostWebRequest postRequest = new PostWebRequest((PostSessionRequest)req);
                    sd.AddWebRequest(postRequest);
                }
            }

            _scriptingData = sd;
        }
        /// <summary>
        /// Executes a GET request.
        /// </summary>
        /// <param name="request"> Get request to execute.</param>
        /// <param name="index"> The request index.</param>
        private void ExecuteGetRequest(GetWebRequest request, int index)
        {
            try
            {
                ConfigureOutputTransforms(request);

                _client.ProxySettings = this.Proxy;
                _client.ExecuteGetWebRequest(new HttpRequestResponseContext(request,index, false));
            }
            catch ( Exception ex )
            {
                AbortSessionRun(ex.ToString());
            }
        }