Introduction to Globus Toolkit 4 at LA GridOUTLINEGETTING READY FOR LAGRIDSETTING UP LAGRID ENVIRONMENTGT4 JAVA WS COREWRITE A STATEFUL WEB SERVICE IN 5 SIMPLE STEPS!!OUR FIRST EXAMPLE: MathServiceMathService: THE 5 STEPS. Step 1: The WSDLSlide 9MathService:THE 5 STEPS Step 2: Implementation in JavaMathService: THE 5 STEPS Step 2: Implementation in JavaMathService: THE 5 STEPS. Step 3: Configuring the Deployment - WSDDWEB SERVICES IN GT4 Agnostic QuestionMathService: THE 5 STEPS. Step 4: Create a GAR file with AntMathService:THE 5 STEPS. Step 5: Deploy the Service into a Web Service ContainerMathService: THE CLIENTHOW TO MAKE THE SERVICE SECURE??Slide 18Slide 19GRID SECURITY INFRASTRUCTURESlide 21SECURE EXAMPLES: WRITING A SECURE MathServerDEMO: SECURE MathServerSlide 24Slide 25GLOBUS TOOLKIT 4 Agnostic QuestionSlide 27Slide 28Slide 29Slide 30Slide 31Slide 32USEFUL LINKSIntroduction to Globus Toolkit 4 at LA GridCIS 6612 – Autonomic Grid ComputingSummer 2006Presenters Fernando Farfán Mayelin FelipeAgnostics Diego López Ramakrishna VaradarajanOUTLINEWEB SERVICES FUNDAMENTALSGRID FUNDAMENTALSOGSA, WSRF & GT4LAGRID @ CIS.FIU.EDUDEVELOPING WS IN LAGRIDUnsecured ExamplesSecure ExamplesGETTING READY FOR LAGRIDGet a Globus Identity certificate signed by the Certificate Authority.http://www.cs.fiu.edu/~esj/globus.htmlEnroll as a Secure Globus User with Eric Johnson.Set these environment variables:1. Set $GLOBUS_LOCATION to /depot/globus-4 2. Set $ANT_HOME to /depot/ant-1.xSETTING UP LAGRID ENVIRONMENTDownload the examples 1. go to http://www.gt4book.com/2. go to Downloads3. select to download the source code for the MathService examples and the FileBuy application Untar/unzip the file1. tar -xvzf gt4book-examples.tar.gzGT4 JAVA WS COREBuilding web services using GT4.Stateful web services!Following WSRF specifications.WRITE A STATEFUL WEB SERVICE IN 5 SIMPLE STEPS!!1. Define the WS interface with WSDL.2. Implement the service with Java.3. Define the deployment parameters with WSDD.4. Compile everything and generate a GAR file with Ant.5. Deploy the service with GT4 tool.OUR FIRST EXAMPLE: MathServiceA simple Math web service.Operations: AdditionSubtractionGet Value.Resources: Value (integer)Last operation performed (String).MathService: THE 5 STEPS. Step 1: The WSDLThe Definition<?xml version="1.0" encoding="UTF-8"?><definitions name="MathService" targetNamespace="http://www.globus.org/namespaces/examples/MathService_instance“ …>…</definition>The Definition<?xml version="1.0" encoding="UTF-8"?><definitions name="MathService" targetNamespace="http://www.globus.org/namespaces/examples/MathService_instance“ …>…</definition>The Port Type<?xml version="1.0" encoding="UTF-8"?><definitions …><portType name="MathPortType" wsrp:ResourceProperties="tns:MathResourceProperties"> <operation name="add"> <input message="tns:AddInputMessage"/> <output message="tns:AddOutputMessage"/> </operation> …</portType></definitions>The Port Type<?xml version="1.0" encoding="UTF-8"?><definitions …><portType name="MathPortType" wsrp:ResourceProperties="tns:MathResourceProperties"> <operation name="add"> <input message="tns:AddInputMessage"/> <output message="tns:AddOutputMessage"/> </operation> …</portType></definitions>The Messages<?xml version="1.0" encoding="UTF-8"?><definitions …><message name="AddInputMessage"> <part name="parameters" element="tns:add"/></message><message name="AddOutputMessage"> <part name="parameters" element="tns:addResponse"/></message></definitions>The Messages<?xml version="1.0" encoding="UTF-8"?><definitions …><message name="AddInputMessage"> <part name="parameters" element="tns:add"/></message><message name="AddOutputMessage"> <part name="parameters" element="tns:addResponse"/></message></definitions>The Response and Request Types<?xml version="1.0" encoding="UTF-8"?><definitions …> <xsd:element name="add" type="xsd:int"/> <xsd:element name="addResponse"> <xsd:complexType/> </xsd:element></definitions>The Response and Request Types<?xml version="1.0" encoding="UTF-8"?><definitions …> <xsd:element name="add" type="xsd:int"/> <xsd:element name="addResponse"> <xsd:complexType/> </xsd:element></definitions>The Resource Properties<xsd:element name=“Value” type=“xsd:int” /><xsd:element name=“LastOp” type=“xsd:string” /><xsd:element name=“MathResourceProperties”>…</xsd:element>The Resource Properties<xsd:element name=“Value” type=“xsd:int” /><xsd:element name=“LastOp” type=“xsd:string” /><xsd:element name=“MathResourceProperties”>…</xsd:element>MathService: THE 5 STEPS. Step 1: The WSDLSteps to write a WSDL document:Write the root element <definitions>Write the <portType>Write an input and output <message> for each operation in the PortTypeWrite the <types>, which includes declaring the request and response elements, along with the resource properties.MathService:THE 5 STEPS Step 2: Implementation in JavaThe Bare Bonespackage org.globus.examples.services.core.first.impl;import java.rmi.RemoteException;import org.globus.examples.stubs.MathService_instance.*;import org.globus.wsrf.*;import org.globus.wsrf.impl.*;public class MathService implements Resource, ResourceProperties { …}The Bare Bonespackage org.globus.examples.services.core.first.impl;import java.rmi.RemoteException;import org.globus.examples.stubs.MathService_instance.*;import org.globus.wsrf.*;import org.globus.wsrf.impl.*;public class MathService implements Resource, ResourceProperties { …}The Resource Properties/* Resource properties */private int value;private String lastOp;/* Get/Setters for the RPs */public int getValue() { return value;}public synchronized void setValue(int value) { this.value = value;}The Resource Properties/* Resource properties */private int value;private String lastOp;/* Get/Setters for the RPs */public int getValue() { return value;}public synchronized void setValue(int value) { this.value = value;}MathService: THE 5 STEPSStep 2: Implementation in JavaThe Web Service Java class includes:Declaration for the ResourcePropertySetDeclaration for the Resource PropertiesConstructor – resource properties are initializedGet/Setters for the Resource PropertiesMethods for the remotely accessible operationsMathService:
View Full Document