Exemple #1
0
        public void GetDataFromTheWebService()
        {
            var sq = new StudentQuery(ApplicationServerAddress, SecurityServerAddress);
            //Login and get session token
            SecurityToken sessionToken = sq.Login(UserName, Password, SchoolId, TenantId);
            //Retrieve student entity based on id
            DataEntityCollectionDTO students = sq.RetrieveSingleLearnerById(Learnerid, sessionToken);

            //Display Student
            sq.DisplayDataInConsoleWindow(students);
            //Logoff
            sq.Logoff(UserName, Password, sessionToken);
        }
Exemple #2
0
        public void SaveDataUsingTheWeservice()
        {
            var sq = new StudentQuery(ApplicationServerAddress, SecurityServerAddress);
            //Logon
            SecurityToken sessionToken = sq.Login(UserName, Password, SchoolId, TenantId);
            //Retrieve student entity based on id
            DataEntityCollectionDTO students = sq.RetrieveSingleLearnerById(Learnerid, sessionToken);
            //we only bring back 1 student so
            DataEntityCollectionDTO changedStudents = sq.MakeModificatons(students, "Dude");

            //Save the student
            sq.Save(changedStudents, sessionToken);
            //Retrive student with new details
            students = sq.RetrieveSingleLearnerById(Learnerid, sessionToken);
            //Display Student
            sq.DisplayDataInConsoleWindow(students);
            //Logoff
            sq.Logoff(UserName, Password, sessionToken);
        }