Now comes a part which might come as a surprise... to try out the service we won't need to program a new client application. We can reuse the client from the previous section. This is due to the fact that this example and the previous share the same service interface (remember how we reused the same GWSDL file). A client is bound to a particular interface, not to a particular implementation. So, as long as we don't modify the service interface, we can reuse both the GWSDL file and the client. Of course, now we'll tell the client to access a new GSH (the one where we've placed the current operation providers example).
First of all, if you haven't compiled the previous example's client (or have erased the compiled class), be sure to compile it now:
javac \ -classpath ./build/classes/:$CLASSPATH \ org/globus/progtutorial/clients/MathService/Client.java
Now, run the client:
java \
-classpath ./build/classes/:$CLASSPATH \
org.globus.progtutorial.clients.MathService.Client \
http://127.0.0.1:8080/ogsa/services/progtutorial/core/providers/MathService \
5
The output should be exactly the same as the previous example's output. Remember that the only thing that's changed from the previous example to this one is that we're using operation providers to implement the service, instead of extending from GridServiceImpl. We haven't modified the internal logic of the service, so the output should be the following:
Added 5 Current value: 5