EduGarage Logo
Search:
Site Map
Upcoming Events:
Please e-mail us if you would like your webinar, conference, or get-together to be featured in this space.
Stay Informed:

I can't get Bruce Phillips' updateaddblackboarduser example to add a user

rated by 0 users
Not Answered This post has 0 verified answers | 1 Reply | 1 Follower

Top 25 Contributor
36 Posts
Rob Tanner posted on 9 Feb 2012 12:42 PM

Hi,

I downloaded and imported into Eclipse Bruce Phillips' updateaddblackboarduser example project. I registered the proxy, ran the application, and I got the user dump that I expected.  By default, the application only runs the getBlackboardUser() method in the BlackboardUserServiceImpl class.  The class also includes a saveBlackboardUser() method, and that's where I'm having a problem.

In the controller class, I added:

    public void saveBlackBoardUser() {
       
        /*
         *  Save the blackboardUser using the User web service
         *  saveUser method.  This should update Blackboard with
         *  any differences with the state of the UserVO versus
         *  what Blackboard has currently
         */
       
        UserExtendedInfoVO detail = new UserExtendedInfoVO();
        detail.setEmailAddress("hpotter@linfield.edu");
        detail.setGivenName("Harry");
        detail.setFamilyName("Potter");
       
        String[] roles = { "STUDENT" };
       
        UserVO who = new UserVO();
        who.setUserBatchUid("9999103");
        who.setId("hpotter");
        who.setName("Harry Potter");
        who.setInsRoles(roles);
        who.setIsAvailable(true);
        who.setDataSourceId("BB9USERS");
   
        who.setExtendedInfo(detail);

        try {
            blackboardUserService.saveBlackboardUser(modulePath,
                blackboardServerURL, sharedSecret, clientVendorId, clientProgramId, who);
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
 
And when I call it from the main app, I get the following:

org.apache.axis2.AxisFault: [User.WS010]Failed to load user entryfor update hpotter
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:435)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:371)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:417)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at edu.ku.it.si.bbuserws.generated.UserWSStub.saveUser(UserWSStub.java:641)
    at edu.ku.it.si.updateaddblackboarduser.service.BlackboardUserServiceImpl.saveBlackboardUser(BlackboardUserServiceImpl.java:528)
    at edu.ku.it.si.updateaddblackboarduser.controller.BlackboardUserController.saveBlackBoardUser(BlackboardUserController.java:114)
    at edu.ku.it.si.updateaddblackboarduser.app.UpdateAddBlackboardUserApp.run(UpdateAddBlackboardUserApp.java:46)
    at edu.ku.it.si.updateaddblackboarduser.app.UpdateAddBlackboardUserApp.main(UpdateAddBlackboardUserApp.java:36)

Any ideas?  I'm in my Blackboard web services newbie phase, so please help me out here if you can.


Thanks,

Rob Tanner
Linfield College

All Replies

Top 25 Contributor
67 Posts

Rob:

   In the updateaddblackboarduser project is a JUnit test that tests the saveBlackboardUser and deleteBlackboardUser methods of class BlackboardUserService (see src/test/java - BlackboardUserServiceTest.java).

   The ReadMe.txt file explains how to setup the test configuration and run it.

   So try setting up and running the test

   Also examine the code in the testSaveAndDeleteBlackboardUserMethod in the test class to see the how the UserVO object is created and what fields are given values.  I think different SP versions of Blackboard may require some fields that another SP version does not require.

   I ran my test with Blackboard Learn 9.1 SP 7.

  Looking at your code I see that your are setting the batch_uid value.  I believe if that value is set in the UserVO object than the web service will try to update an existing user.  The first error message in your stack trace also seems to indicate that the web service is trying to update a user that doesn't exist.

  If you can get the test class to run successfully then try modifying your saveBlackboardUser method and only set the UserVO fields that are set in the testSaveAndDeleteBlackboardUserMethod.

  If you cannot get the test class to run successfully and you have setup all the test class values (see the beginning of the test class) then post what error you receive and your complete Blackboard Learn version and service pack.

 

Bruce Phillips

 

 

 

 

 

Page 1 of 1 (2 items) | RSS
© 2006-2009 Blackboard Inc. All Rights Reserved. Blackboard, the Blackboard logo, and EduGarage are trademarks
or registered trademarks of Blackboard Inc. in the United States and/or other countries.