Python WSRF Programmers' Tutorial

Joshua Boverhof

Lawrence Berkeley National Lab
Computational Research Department

This tutorial is available for use and redistribution under the terms of the Globus Toolkit Public License

This tutorial is just an adaptation of Borja's GT4 Tutorial for the pyGridWare framework, most of the contents were directly copied.


Table of Contents
Introduction
1. GT4 Prerequisite Documents
2. Audience
3. Assumptions
4. Related Documents
5. Document Conventions
5.1. Code
5.2. Inlined code
5.3. Shell commands
5.4. Notes
6. About the author & acknowledgments
6.1. Acknowledgments
I. Getting Started
1. Key Concepts
1.1. OGSA, WSRF, and GT4
1.2. A short introduction to Web Services
1.3. WSRF: The Web Services Resource Framework
1.4. The Globus Toolkit 4
1.5. Where to learn Python & XML
2. Installation
II. GT4 Core
3. Writing a NON-WSRF Stateful Web Service
3.1. Step 1: Defining the interface in WSDL
3.2. Step 2: Create a New WSRF Site
3.3. Step 3: Implement the service
3.4. Step 4: Deploy the service
3.5. Barebones MathService client.
4. Writing a WS-RF Service with Multiple Resources
4.1. The WS-Resource factory pattern
4.2. Implementing the WS-Resource factory pattern in pyGridWare
4.3. Create a New Site
4.4. Resource Creation, Modification, and Destruction
4.5. Finished MathService Service
4.6. MathService.wsdl: WSDL code for a WSRF service
4.7. Installing the MathService.rpy script
4.8. The ResourceHome and Persistence
4.9. Sample Client using an EndpointReference
5. Resource Properties
5.1. A closer look at resource properties
5.2. Extending The MathPortType: A New WSDL file
5.3. Create a New Site
5.4. New MathService.rpy Script
5.5. Client code
6. Lifecycle Management
6.1. Immediate destruction
6.2. Scheduled destruction
6.3. Immediate and Scheduled Termination MathService WSDL
7. Notifications
7.1. What are notifications?
7.2. WS-Notifications
7.3. Notifications in GT4
7.4. Notifying changes in a resource property
7.5. MathService WSDL NotificationProducer
List of Figures
1-1. Relationship between OGSA, WSRF, and Web Services
1-2. Relationship between OGSA, GT4, WSRF, and Web Services
1-3. Layered diagram of OGSA, GT4, WSRF, and Web Services
1-4. Web Services
1-5. A typical Web Service invocation
1-6. The Web Services architecture
1-7. Client and server stubs are generated from the WSDL file
1-8. A typical Web Service invocation (more detailed)
1-9. The server side in a Web Services application
1-10. A stateless Web Service invocation
1-11. A stateful Web Service invocation
1-12. The resource approach to statefulness
1-13. A Web Service with several resources. Each resource represents a file.
1-14. WS-Resource
1-15. GT4 architecture
4-1. The WS-Resource factory pattern
4-2. Relationships between the Factory Service, the Instance Service, the Resource Home, and the Resource
4-3. Sequence diagram for resource creation
4-4. Sequence diagram for WS-Resource invocation
7-1. Keeping track of changes using polling
7-2. Keeping track of changes using notifications
7-3. A WS-Notification interaction where the subscriber and the consumer are different entities
7-4. A WS-Notification interaction where the subscriber and the consumer are different entities
7-5. A typical brokered WS-Notification interaction