Exemplo n.º 1
0
        private async Task <GradebookWSPortTypeClient> GetGradebookClient()
        {
            await Activate();

            var endpoint  = new EndpointAddress($"{BaseUrl}/Gradebook.WS");
            var gradebook = new GradebookWSPortTypeClient(_defaultBinding, endpoint);

            gradebook.Endpoint.Behaviors.Add(
                new WsSecurityBehavior(new MessageInspector(new SecurityHeader("session", _sessionKey))));
            await gradebook.initializeGradebookWSAsync(false);

            return(gradebook);
        }
Exemplo n.º 2
0
        public async Task <saveGradesResponse> SaveGrades(string courseId, ScoreVO[] grades)
        {
            _tryCount += 1;

            if (_tryCount == 3)
            {
                await ResetConnection();

                _gradeClient = null;
            }

            if (_gradeClient == null)
            {
                _gradeClient = await GetGradebookClient();
            }
            var saveResp = await _gradeClient.saveGradesAsync(courseId, grades, false);

            _tryCount = 0;
            return(saveResp);
        }
Exemplo n.º 3
0
        public async Task <ColumnVO[]> BbColumns(string courseId, ColumnFilter filter)
        {
            _tryCount += 1;

            if (_tryCount == 3)
            {
                await ResetConnection();

                _gradeClient = null;
            }

            if (_gradeClient == null)
            {
                _gradeClient = await GetGradebookClient();
            }
            var colVo = await _gradeClient.getGradebookColumnsAsync(courseId, filter);

            _tryCount = 0;
            return(colVo.@return);
        }