Calling On Demand Tasks

From PresenceWiki
Revision as of 09:47, 6 April 2009 by Graham (Talk | contribs)

Jump to: navigation, search

There are 3 ways to call On Demand Tasks

1: Via a tag in the web file

         <presence:remote-task presenceHost="presenceserver.com" alias="newtime" />

2: Through the url by referencing the http server followed by 'task' and then the task alias

         http://localhost/task/newtime

3: Through the On Demand API

       This is a lightweight implementation, so that the jars you will need for this are
       
       presenceOnDemand.jar
       presenceCommon.jar
       pbtools57.jar
       pbembedded57.jar
       pbclient57.jar
       log4j-1.2.8.jar
       xercesImpl.jar
       As well as this you will need a copy of install.inf in a res directory 
       and a copy of presenceconfig.xml into a res\config directoy
       After this you can create OnDemandRequest in your java code
       OnDemandRequest request = new OnDemandRequest();
       request.setTimeOut(3000);
       request.setHost("192.168.1.103");
       request.setPort(8221);
       request.setRequestParameters(null);
       request.setAlias("newtime");
       try
       {
            request.makeRequest();
            System.out.print (request.getResponse());	
       }
       catch (IOException e) 
       {
            e.printStackTrace();	
       }
       catch (GeneralSecurityException gse) 
       {
            gse.printStackTrace();	
       }