AnsweredAssumed Answered

getGradebookColumns web service call returns null

Question asked by mike.warner on Nov 12, 2015
Latest reply on Nov 16, 2015 by mike.warner

I'm trying to pull columns either by name or by columnId, but am getting null as the return.

 

The PHP code for this is (from a slightly modified bb_ws.php, originally by Stephen P Vickers):

 

                try{

                    $gradebook_client = new BbSoapClient(SERVER_URL . '/webapps/ws/services/Gradebook.WS?wsdl');

                } catch (Exception $e) {

                    $ok = FALSE;

                    print "ERROR: {$e->getMessage()}\n";

                }

                  

                $courseId=$argv[2];

                $columnName_or_Id=$argv[3];

                $columnFilterType=$argv[4];

              

                $columnFilter = new stdClass();

                $columnFilter->columnFilterType = $columnFilterType;

           

                if($columnFilterType==2){

                    $columnFilter->names=$columnName_or_Id;

                }

                if($columnFilterType==3){

                    $columnFilter->ids=$columnName_or_Id;

                }

                if($columnFilterType==4){

                    $columnFilter->externalGrade=0;

                }

 

                $columnFilters=(array) $columnFilter;

                $params = array();

                $params["courseId"] = $courseId;        

                $params["filter"] = $columnFilters;

                echo "\ngetGradebookColumns request:\n";       

                print_r($params);

                try{

                    $result = $gradebook_client->getGradebookColumns($params);

                }catch(Exception $e){

                    echo "ERROR: {$e->getMessage()}\n";

                }

                echo "\ngetGradebookColumns result:\n";       

                var_dump(get_object_vars($result));


I've tried all filter types (GET_COLUMN_BY_COURSE_ID_AND_COLUMN_NAME is 2, GET_COLUMN_BY_IDS is 3, GET_COLUMN_BY_COURSE_ID is 1, GET_COLUMN_BY_EXTERNAL_GRADE_FLAG is 4) with the corresponding filter data, but always get NULL back from BB.

 

BB version is 9.1.201404.160205, but I'm getting the same results on a 9.13 system.


I'm able to use web services to create columns and save grades to the newly created cols, so I know that I can use the gradebook WS.

 

Can anyone point me in the right direction?

 

Mike

Outcomes