GT 3.9.5 Samples for Java WS Core

Counter Sample

Using counter-client.

1

Change to $GLOBUS_LOCATION directory:

 $ cd $GLOBUS_LOCATION
2

Start the container by running:

 $ bin/globus-start-container -nosec
3

In another window, run:

 $ bin/counter-client -s http://localhost:8080/wsrf/services/CounterService

As a result you should see something like the following:

 $ bin/counter-client -s http://localhost:8080/wsrf/services/CounterService
   Counter service: http://localhost:8080/wsrf/services/CounterService
   Got notification with value: 3
   Counter has value: 3
   Got notification with value: 13

Please note if secure container is used (started without the -nosec argument) please make sure to pass the correct service url (https protocol, right port number) to counter-client and add -z argument at the end of the command line. For example:

 $ bin/counter-client -s https://localhost:8443/wsrf/services/CounterService -z none

The -z none option disables client-side authorization. By default the client performs host authorization and if the server is not running with host credentials the client authorization will fail. Also, the server must be properly configured to authorize the client. Please see the security documentation for details.

Using counter-create, counter-add clients.

1

Change to $GLOBUS_LOCATION directory:

 $ cd $GLOBUS_LOCATION
2

Start the container by running:

 $ bin/globus-start-container -nosec
3

In another window, run:

 $ bin/counter-create -s http://140.221.36.11:8080/wsrf/services/CounterService > epr

If successful, a new counter resource will be created and the endpoint information of that resource will be saved in the file called epr.
That epr file can be passed to a number of the basic wsrf-* and wsn-* clients using the -e option.

Please note if secure container is used (started without the -nosec argument) please make sure to pass the correct service url (https protocol, right port number) to counter-create and add -z argument to the command line. For example:

 $ bin/counter-create -s https://localhost:8443/wsrf/services/CounterService -z none > epr

4

In the same window, run (a couple of times):

 $ bin/counter-add -e epr 2

As a result you should see something like the following:

 $ bin/counter-add -e epr 2
   2          
 $ bin/counter-add -e epr 2
   4

Please note that if secure container was used you might need to add -z argument to the command line. For example:

 $ bin/counter-add -e epr -z none 2