Sie sind auf Seite 1von 5

STEPS IN GRID

1. Open S:/Grid extract the following files


Apache-tomcat-7.0.70-windows-x86
Apache-ant-1.9.7
Axis2-1.7.3-bin
Gt4book-examples
GridSphere-master
ws-core-4.0.0
2. Install python-2.7.12 and it will be stored in C:\
3. Set environmental variables
S.NO VARIABLE NAME PATH
3.1 JAVA_HOME C:\Program Files\Java\jdk1.8.0_92

3.2 ANT_HOME S:\Grid\apache-ant-1.9.7


3.3 CATALINA_HOME S:\Grid\apache-tomcat-7.0.70
3.4 GLOBUS_LOACTION S:\Grid\ws-core-4.0.0
3.5 AXIS_HOME S:\Grid\axis2-1.7.3
3.6 path ; C:\Program Files\Java\jdk1.8.0_92\bin;
S:\Grid\apache-ant-1.9.7\bin; S:\Grid\apache-tomcat-
7.0.70\bin; S:\Grid\axis2-1.7.3\bin; S:\Grid\ws-core-
4.0.0\bin; C:\Python27

4 .Open two command prompts and follow the steps:

i) In first command prompt


S:\Grid\ws-core-4.0.0\bin>globus-start-container nosec
It displays the number of process running in the system.

ii) In second command prompt:


S:\Grid\gt4book-examples>globus-build-service.py first
iii) S:\Grid\gt4book-examples>globus-deploy-gar
org_globus_examples_services_core_first.gar
iv) In first command prompt
Repeat the command again
S:\Grid\ws-core-4.0.0\bin>globus-start-container nosec
It displays the number of process running in the system (count will be incremented by
one i.e., our Math Service will be added at last)

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

and contains the following code:


package org.globus.examples.clients.MathService_instance;
import org.apache.axis.message.addressing.Address;
import org.apache.axis.message.addressing.EndpointReferenceType;
import org.globus.examples.stubs.MathService_instance.MathPortType;
import org.globus.examples.stubs.MathService_instance.GetValueRP;
import
org.globus.examples.stubs.MathService_instance.service.MathServiceAddressingLocator;

public class Client {

public static void main(String[] args) {


MathServiceAddressingLocator locator = new
MathServiceAddressingLocator();

try {
String serviceURI = args[0];

// Create endpoint reference to service


EndpointReferenceType endpoint = new
EndpointReferenceType();
endpoint.setAddress(new Address(serviceURI));

MathPortType math;

// Get PortType
math = locator.getMathPortTypePort(endpoint);

// Perform an addition
math.add(10);

// Perform another addition


math.add(5);

// 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

2) Run the program:


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: 15
Current value: 10

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

Das könnte Ihnen auch gefallen