Beispiel #1
0
 public GetProfileRequestBody(int Genere, int MobileFrequenzaGioco, bool MobileGiocoAvventura, bool MobileGiocoAzione, bool MobileGiocoGDR, bool MobileGiocoPuzzle, bool MobileGiocoSimulazione, bool MobileGiocoStrategia, SoftSkill.ArrayOfInt1 RisposteQuestionario)
 {
     this.Genere = Genere;
     this.MobileFrequenzaGioco   = MobileFrequenzaGioco;
     this.MobileGiocoAvventura   = MobileGiocoAvventura;
     this.MobileGiocoAzione      = MobileGiocoAzione;
     this.MobileGiocoGDR         = MobileGiocoGDR;
     this.MobileGiocoPuzzle      = MobileGiocoPuzzle;
     this.MobileGiocoSimulazione = MobileGiocoSimulazione;
     this.MobileGiocoStrategia   = MobileGiocoStrategia;
     this.RisposteQuestionario   = RisposteQuestionario;
 }
Beispiel #2
0
 public System.Threading.Tasks.Task <SoftSkill.GetProfileFullResponse> GetProfileFullAsync(int Genere, int MobileFrequenzaGioco, bool MobileGiocoAvventura, bool MobileGiocoAzione, bool MobileGiocoGDR, bool MobileGiocoPuzzle, bool MobileGiocoSimulazione, bool MobileGiocoStrategia, SoftSkill.ArrayOfInt1 RisposteQuestionario)
 {
     SoftSkill.GetProfileFullRequest inValue = new SoftSkill.GetProfileFullRequest();
     inValue.Body        = new SoftSkill.GetProfileFullRequestBody();
     inValue.Body.Genere = Genere;
     inValue.Body.MobileFrequenzaGioco   = MobileFrequenzaGioco;
     inValue.Body.MobileGiocoAvventura   = MobileGiocoAvventura;
     inValue.Body.MobileGiocoAzione      = MobileGiocoAzione;
     inValue.Body.MobileGiocoGDR         = MobileGiocoGDR;
     inValue.Body.MobileGiocoPuzzle      = MobileGiocoPuzzle;
     inValue.Body.MobileGiocoSimulazione = MobileGiocoSimulazione;
     inValue.Body.MobileGiocoStrategia   = MobileGiocoStrategia;
     inValue.Body.RisposteQuestionario   = RisposteQuestionario;
     return(((SoftSkill.wsTestPlayPublicSoap)(this)).GetProfileFullAsync(inValue));
 }
Beispiel #3
0
        public GetWSResultDto returnGetProfileWSResultDto([FromBody] SurveyData surveyData)
        {
            // Setting up the configuration for consuming web service
            SoftSkill.wsTestPlayPublicSoapClient.EndpointConfiguration endpointConfiguration
                = new SoftSkill.wsTestPlayPublicSoapClient.EndpointConfiguration();

            // Consuming the web service providing necessary credentials.
            SoftSkill.wsTestPlayPublicSoapClient wsTestPlayPublicSoapClient =
                new SoftSkill.wsTestPlayPublicSoapClient(endpointConfiguration,
                                                         "http://wsplay.laborplay.com/wsTestPlayPublic.asmx");

            // Converting the answer array to web service supported ArrayOfInt1 format
            // Declaring an empty array of ArrayOfInt1
            SoftSkill.ArrayOfInt1 iSelectListArray = new SoftSkill.ArrayOfInt1();
            for (int i = 0; i < 52; i++)
            {
                // Assigning the data into the list
                iSelectListArray.Add(Int32.Parse(surveyData.SelectListArray[i]));
            }

            // Calling the web service GetProfile
            var result =
                wsTestPlayPublicSoapClient.GetProfileAsync(
                    Int32.Parse(surveyData.FeedbackArray[0]),
                    Int32.Parse(surveyData.FeedbackArray[1]),
                    bool.Parse(surveyData.FeedbackArray[2]),
                    bool.Parse(surveyData.FeedbackArray[3]),
                    bool.Parse(surveyData.FeedbackArray[4]),
                    bool.Parse(surveyData.FeedbackArray[5]),
                    bool.Parse(surveyData.FeedbackArray[6]),
                    bool.Parse(surveyData.FeedbackArray[7]),
                    iSelectListArray
                    );

            try
            {
                // Declaring and initializing the web service result data to dto object.
                GetWSResultDto getProfileWSResultDto = new GetWSResultDto();
                // Assigning the value of P from web service result
                getProfileWSResultDto.P = result.Result.Body.GetProfileResult.P;
                // Assigning the value of L from web service result
                getProfileWSResultDto.L = result.Result.Body.GetProfileResult.L;
                // Assigning the value of A from web service result
                getProfileWSResultDto.A = result.Result.Body.GetProfileResult.A;
                // Assigning the value of Y from web service result
                getProfileWSResultDto.Y             = result.Result.Body.GetProfileResult.Y;
                getProfileWSResultDto.ProfileIdProp = result.Result.Body.GetProfileResult.ProfileIDProp;
                // Assigning static 2 as the value of soft skill test id to define
                // that which method is calling from the web service.
                getProfileWSResultDto.SoftSkillTestId = 1;
                // Assigning static S following the requirement.
                getProfileWSResultDto.SoftSkillTestQuiz = "S";
                getProfileWSResultDto.SurveyorEmail     = surveyData.Email;
                return(getProfileWSResultDto);
            }
            catch
            {
                // Retrieving the error data when the web service is failed to
                // response properly.
                var wsResult = "Id: " + result.Id + "\n Status: " + result.Status;
                // Initiating static mail header.
                var mailbody = "<br />Hello " + "Isabella" + " Pinzauti" + ",<br /><br /> <br/>" + "Here is the web service provided result for GetProfile : <br /> " + wsResult + "<br /><br /><b> N.B:  Please do not reply in this mail </b><br /><br /> Thanks, <br /> Talent Team";
                // Initiating the static mail address to whom the error informing
                // mail will be sent.
                _emailManager.To.Add("*****@*****.**");
                // Initiating the mail subject.
                _emailManager.Subject = "Web_Service_Issue_Talent";
                // Initiating the mail body
                _emailManager.Body = mailbody.ToString();
                // Sending the mail to the recipient.
                _emailManager.Send();
                // Returning null as didn't get any result from web service.
                return(null);
            }
        }