AnsweredAssumed Answered

webservices intermittently fail with ws.getLastError:[WSFW000]null

Question asked by wh0046497 on Aug 3, 2016
Latest reply on Sep 8, 2016 by kevin.ghantous

I keep getting an intermittent failure from pretty well every webservice call I have tried when connecting to our new remotely hosted load copy of blackboard - they mostly work and return data but every now and again they return nothing. The locally hosted version did not have this problem.

for example if I run the code below 10 times I get:

 

1 Worked courses count: 859  
2 Worked courses count: 859  
3 Worked courses count: 859  
4 Worked courses count: 859  
5 Worked courses count: 859  
6 Worked courses count: 859  
7 Failed No Courses ws.getLastError:[WSFW000]null
8 Worked courses count: 859  
9 Failed No Courses ws.getLastError:[WSFW000]null
10 Worked courses count: 859  

 

 

As you can see I called exactly the same webservice 10 times but  I get 20% of calls failing.

I noticed that ws.getLastError has a value of "[WSFW000]null" when it fails whatever that means?

 

              int counter =0;

              bool login;

               while (counter<10)

               {

                WebserviceWrapper ws = new WebserviceWrapper("########", "###", "#########", 100);

                 ws.initialize_v1();

                 login= ws.loginUser("#########", "#########");

                 CourseFilter cf = new CourseFilter();

                  cf.filterType = 0 //GET_ALL_COURSES;

                  cf.filterTypeSpecified = true;

                  cf.available = 1;

                  cf.availableSpecified = true;

                  CourseWrapper crsWr = ws.getCourseWrapper();

                  CourseVO[] courses = crsWr.loadCourses(cf);

                   if ((courses?.Count() ?? 0) > 0)
                   {
                         console,writeline($"{counter} Worked courses count: {courses?.Count()  }   \r\n ");       
                   }
                   else
                   {
                     console,writeline($"{counter} Failed No Courses ws.getLastError:{ws.getLastError()}\r\n ");
                   }

               login= ws.getContextWrapper().logout();

              counter ++;

          }

 

 

 

Any one got any ideas on how to fix this?

Also I am trying to get all Courses, Users and memberships out of blackboard using webservices, in order to get the information I need I have been having to :

  1. get all courses
  2. Loop through each course to get its membership
  3. Get users from users id's in the membership record

This is hundereds of webservice calls is there any other way of doing this?

Outcomes