1

I want to fetch all the activities within a course. I have used below code, but it results me 0 record.

public static ActivityVO[] getActivity(String p_courseId) {
        GetActivity l_getActivity = new GetActivity();
        ActivityFilter l_filter = new ActivityFilter();
        l_filter.setFilterType(3);
        l_filter.setCourseId(p_courseId);
        l_filter.setAvailable(true);
        l_filter.setUserid("loginUsername");
        Calendar l_start = Calendar.getInstance();
        Calendar l_end = Calendar.getInstance();
        l_start.set(2014,Calendar.JANUARY,1);
        l_end.set (2016,Calendar.MARCH,18);
        l_filter.setStartTime(l_start.getTimeInMillis()/1000);
        l_filter.setEndTime(l_end.getTimeInMillis()/1000);
        l_getActivity.setFilter(l_filter);
        try {
            System.out.println("->"+m_activityWS.getActivity(l_getActivity).get_return());
        } catch (RemoteException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        try {
            return m_activityWS.getActivity(l_getActivity).get_return();
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;
    }

Can anyone tell me if I am missing something all provide me a sample code. Thanks in advance.

Neha
  • 143
  • 4
  • 19
  • Need to know what the `m_activityWS.getActivity` function does please – jr593 May 16 '16 at 10:34
  • It is a variable for "ActivityWSStub " that I have declared globally, and "ActivityWSStub" is the autogenerated stub file created by the activity wsdl – Neha May 16 '16 at 10:39
  • getActivity results the GetActivityResponse object, this function is also autogenerated – Neha May 16 '16 at 10:44

0 Answers0