Beruflich Dokumente
Kultur Dokumente
v) Setting classpath
S:\Grid\gt4book-examples>%GLOBUS_LOCATION%\etc\globus-devel-env.bat
S:\Grid\gt4book-examples>echo %CLASSPATH%
.;S:\Grid\ws-core-4.0.0;S:\Grid\ws-core-4.0.0\build\classes;S:\Grid\ws-core-
4.0.0\lib\xmlsec.jar;S:\Grid\ws-core-4.0.0\lib\xml-apis.jar;S
ore-4.0.0\lib\wsrf_provider_jce.jar;S:\Grid\ws-core-4.0.0\lib\wsrf_core_stubs.jar;S:\Grid\ws-
core-4.0.0\lib\wsrf_core_samples_mgmt_stubs.
jar;S:\Grid\ws-core-4.0.0\lib\wsrf_core.jar;S:\Grid\ws-core-
4.0.0\lib\wsrf_common.jar;S:\Grid\ws-core-4.0.0\lib\wsdl4j.jar;S:\Grid\ws-cor
va.jar;S:\Grid\ws-core-4.0.0\lib\naming-factory.jar;S:\Grid\ws-core-4.0.0\lib\naming-
common.jar;S:\Grid\ws-core-4.0.0\lib\log4j-1.2.8.jar
EXERCISE: MathService
1) Program resides in the following Path
GT4Services\org\globus\examples\clients\MathService_instance\Client.java
try {
String serviceURI = args[0];
MathPortType math;
// Get PortType
math = locator.getMathPortTypePort(endpoint);
// Perform an addition
math.add(10);
// Access value
System.out.println("Current value: "
+ math.getValueRP(new GetValueRP()));
// Perform a subtraction
math.subtract(5);
// Access value
System.out.println("Current value: "
+ math.getValueRP(new GetValueRP()));
} catch (Exception e) {
e.printStackTrace();
}
}
}
1) Compile the program:
S:\Grid\gt4book-examples>javac -classpath
build\classes\org\globus\examples\services\core\first\impl\:%CLASSPATH%
org\globus\examples\clients\MathService_instance\Client.java
3) S:\Grid\gt4book-examples>java -classpath
build\classes\org\globus\examples\services\core\first\impl\:%CLASSPATH%
org.globus.examples.clients.MathService_instance.Client
http://localhost:8080/wsrf/services/examples/core/first/MathService
Current value: 25
Current value: 20