Skip navigation
 

Calling Web Services from Proxy Tools
Added by George Kroner, last edited by Paul Monk on 15 Dec 2007 01:27 PM
(None)

As of Vista 4 Service Pack 1 (and Campus Edition Service Pack 1), you can call PowerLinks SDK web services from within authentication modules. For example, the following code creates an instance of the ContextSDK, gets a SessionVO for the current user, and retrieves the LearningCtxtVO for the current learning context.

public boolean commit() throws LoginException
{
    try
    {
         ContextSDK ctx = new ContextSDK();
         SessionVO sess = ctx.getCurrentSession();
         long lcid = this.getWebCTSSOContext().getCurrentLearningContextId().longValue();
         LearningCtxtVO lc = ctx.getLearningContext(sess, lcid);
         String html = "" +
             "Learning Context Info: " + lc.getName() + "" +
             "Description:" + lc.getDesc() + " ";
         this.setResponseContent(html);
         return true;
    }
    catch(Exception e)
    {
        throw new LoginException(e.toString());
    }
}

You can also log in as another user by calling one of the ContextSDK's login methods and passing the appropriate credentials. Note that while this article is about proxy tools/outbound auth mods, you can also call web service methods from within inbound auth mods. However, if you use getCurrentSession() to get the current user session in an inbound request and no user is currently logged in through this session, it will return a SessionVO for a guest user, which will probably not be too useful. You would need to use one of the login methods in this case.

With the exception of the Assessment web service, all web services (including the new Announcement SDK) can be called from within auth mods. If you'd like to see a working example, take a look at the Calendar Entry Import PowerLink 2.0.

Adaptavist Theme Builder Powered by Atlassian Confluence

By accessing the Knowledge Base, you agree to the following: Blackboard makes no representations or warranties as to the accuracy of any information in the Knowledge Base. Blackboard is not responsible in any way for information provided to the Knowledge Base by third parties. Information in the Knowledge Base is not documentation for any Blackboard product. Nothing in the Knowledge Base shall be deemed to modify your license in any way to any Blackboard product. Blackboard reserves the right to use your name and the name of your institution in reference to any information submitted by you to the Knowledge Base. Blackboard may modify, distribute, republish in any format, delete, incorporate or use in any way the information that you contribute to the Knowledge Base.