Difference between revisions of "Calling On Demand Tasks"

From PresenceWiki
Jump to: navigation, search
Line 1: Line 1:
 
There are 3 ways to call On Demand Tasks
 
There are 3 ways to call On Demand Tasks
  
1: Via a tag in the web file:-
+
==1: Via a tag in the web file==
  
 
           <presence:remote-task presenceHost="presenceserver.com" alias="newtime" />
 
           <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 :-
+
==2: Through the url by referencing the http server followed by 'task' and then the task alias==
  
 
           http://localhost/task/newtime
 
           http://localhost/task/newtime
  
3: Through the On Demand API:-
+
==3: Through the On Demand API==
  
         This is a lightweight implementation, so that the jars you will need for this are:-
+
         This is a lightweight implementation, so that the jars you will need for this are
 
          
 
          
 
         presenceOnDemand.jar
 
         presenceOnDemand.jar
Line 24: Line 24:
 
         and a copy of presenceconfig.xml into a res\config directoy
 
         and a copy of presenceconfig.xml into a res\config directoy
  
         After this you can create OnDemandRequest in your java code:-
+
         After this you can create OnDemandRequest in your java code
  
 
         OnDemandRequest request = new OnDemandRequest();
 
         OnDemandRequest request = new OnDemandRequest();

Revision as of 13:47, 6 April 2009

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();	
       }