Ejemplo n.º 1
0
        public ActWebAPISoap CreateActWebAPISOAP(ApplicationAPIModel AAMB, ActWebAPIModel ActWebAPIModel)
        {
            ActWebAPISoap actWebAPISoap = new ActWebAPISoap();

            FillAPIBaseFields(AAMB, actWebAPISoap, ActWebAPIModel);
            return(actWebAPISoap);
        }
Ejemplo n.º 2
0
        public ActWebAPIRest CreateActWebAPIREST(ApplicationAPIModel AAMB, ActWebAPIModel ActWebAPIModel)
        {
            ActWebAPIRest actWebAPIBase = new ActWebAPIRest();

            FillAPIBaseFields(AAMB, actWebAPIBase, ActWebAPIModel);
            return(actWebAPIBase);
        }
Ejemplo n.º 3
0
        private void SetExecutionValue <T>(T param, ActWebAPIModel actWebAPIModel)
        {
            AppModelParameter     p            = param as AppModelParameter;
            EnhancedActInputValue enhanceInput = actWebAPIModel.APIModelParamsValue.Where(x => x.ParamGuid == p.Guid).FirstOrDefault();

            if (enhanceInput != null)
            {
                p.ExecutionValue = enhanceInput.ValueForDriver;
            }
            else
            {
                p.ExecutionValue = p.GetDefaultValue();
            }

            if (p is GlobalAppModelParameter && p.ExecutionValue.Equals(GlobalAppModelParameter.CURRENT_VALUE))
            {
                p.ExecutionValue = ((GlobalAppModelParameter)p).CurrentValue;
            }
        }
Ejemplo n.º 4
0
        private ApplicationAPIModel SetAPIModelData(ApplicationAPIModel AAMB, ActWebAPIModel actWebAPIModel)
        {
            WorkSpace.Instance.RefreshGlobalAppModelParams(AAMB);
            //Duplicate Model for not changing on cache
            ApplicationAPIModel AAMBDuplicate = (ApplicationAPIModel)AAMB.CreateCopy(false);

            //Set model params with actual execution value
            foreach (AppModelParameter modelParam in AAMBDuplicate.AppModelParameters)
            {
                SetExecutionValue(modelParam, actWebAPIModel);
            }

            foreach (GlobalAppModelParameter globalParam in AAMBDuplicate.GlobalAppModelParameters)
            {
                SetExecutionValue(globalParam, actWebAPIModel);
            }

            actWebAPIModel.ActAppModelParameters = AAMBDuplicate.MergedParamsList;

            //Replace Placeholders with Execution Values
            AAMBDuplicate.SetModelConfigsWithExecutionData();
            return(AAMBDuplicate);
        }
Ejemplo n.º 5
0
        private ObservableList <ActInputValue> ConvertAPIModelKeyValueToActInputValues(ObservableList <APIModelKeyValue> GingerCoreNETHttpHeaders, ActWebAPIModel actWebAPIModel)
        {
            ObservableList <ActInputValue> GingerCoreHttpHeaders = new ObservableList <ActInputValue>();

            if (GingerCoreNETHttpHeaders != null)
            {
                foreach (APIModelKeyValue AMKV in GingerCoreNETHttpHeaders)
                {
                    ActInputValue AIV = new ActInputValue();
                    AIV.Param          = AMKV.Param;
                    AIV.ValueForDriver = ReplacePlaceHolderParameneterWithActual(AMKV.Value, actWebAPIModel.APIModelParamsValue);
                    GingerCoreHttpHeaders.Add(AIV);
                }
            }
            return(GingerCoreHttpHeaders);
        }
Ejemplo n.º 6
0
        private void FillAPIBaseFields(ApplicationAPIModel AAMB, ActWebAPIBase actWebAPIBase, ActWebAPIModel actWebAPIModel)
        {
            ApplicationAPIModel AAMBDuplicate = SetAPIModelData(AAMB, actWebAPIModel);

            //Initializing Act Properties
            actWebAPIBase.AddNewReturnParams = actWebAPIModel.AddNewReturnParams;
            actWebAPIBase.SolutionFolder     = actWebAPIModel.SolutionFolder;
            actWebAPIBase.SupportSimulation  = actWebAPIModel.SupportSimulation;
            actWebAPIBase.AddOrUpdateInputParamValue(nameof(ActWebAPIBase.UseLegacyJSONParsing), "False");
            actWebAPIBase.Description = actWebAPIModel.Description;
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIRest.Fields.RequestType, AAMBDuplicate.RequestType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIRest.Fields.ReqHttpVersion, AAMBDuplicate.ReqHttpVersion.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIRest.Fields.ResponseContentType, AAMBDuplicate.ResponseContentType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIRest.Fields.CookieMode, AAMBDuplicate.CookieMode.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIRest.Fields.ContentType, AAMBDuplicate.ContentType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPISoap.Fields.SOAPAction, AAMBDuplicate.SOAPAction);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.EndPointURL, AAMBDuplicate.EndpointURL);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.NetworkCredentialsRadioButton, AAMBDuplicate.NetworkCredentials.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.URLUser, AAMBDuplicate.URLUser);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.URLDomain, AAMBDuplicate.URLDomain);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.URLPass, AAMBDuplicate.URLPass);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.DoNotFailActionOnBadRespose, AAMBDuplicate.DoNotFailActionOnBadRespose.ToString());
            actWebAPIBase.HttpHeaders = ConvertAPIModelKeyValueToActInputValues(AAMBDuplicate.HttpHeaders, actWebAPIModel);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.RequestBodyTypeRadioButton, AAMBDuplicate.RequestBodyType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.RequestBody, AAMBDuplicate.RequestBody);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.CertificateTypeRadioButton, AAMBDuplicate.CertificateType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.CertificatePath, AAMBDuplicate.CertificatePath);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.ImportCetificateFile, AAMBDuplicate.ImportCetificateFile.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.CertificatePassword, AAMBDuplicate.CertificatePassword);
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.SecurityType, AAMBDuplicate.SecurityType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.AuthorizationType, AAMBDuplicate.AuthorizationType.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.TemplateFileNameFileBrowser, AAMBDuplicate.TemplateFileNameFileBrowser.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.AuthUsername, AAMBDuplicate.AuthUsername.ToString());
            actWebAPIBase.AddOrUpdateInputParamValueAndCalculatedValue(ActWebAPIBase.Fields.AuthPassword, AAMBDuplicate.AuthPassword.ToString());

            actWebAPIBase.ReturnValues = actWebAPIModel.ReturnValues;
        }