51
Building services in WSRF Ben Clifford Draft 2004-07-09 For GGF summer school, July 2004

Building services in WSRF

  • Upload
    sidone

  • View
    40

  • Download
    0

Embed Size (px)

DESCRIPTION

Building services in WSRF. Ben Clifford Draft 2004-07-09 For GGF summer school, July 2004. outline. Webservices – should be covered by EGEE, so just one slide of concepts, eg. WSDL without further expl. - PowerPoint PPT Presentation

Citation preview

Page 1: Building services in WSRF

Building services in WSRFBen Clifford

Draft 2004-07-09For GGF summer school, July

2004

Page 2: Building services in WSRF

outline Webservices – should be covered by EGEE, so just one slide of concepts,

eg. WSDL without further expl. WSRF – what WSRF adds – do we need to discuss why or will that be

covered in earlier sections? Eg. Carl’s intro? Introduce WS-Resource WS-Resource Properties Exercise: stand up supplied installation and get running (maybe before WS-

Resource intro) Exercise: talk to someone else’s service on a different laptop Exercise: add a resource property to the service – add one which is ‘last

incremeted time’. Query own counters and query other peoples’ counters. * Advanced students add another one of their choice.

Exercise: lifetime management: create new counters. Destroy old counters. Exercise: create a new counter resource and then register it to service

group – front screen will display fishies. (advanced exercise: if fish has a FishName RP, use that instead of IP address)

2 hours exercise = 60 slides = 15 slides per module

Page 3: Building services in WSRF

Module 1 Overview WSRF Globus Alliance WSRF implementation

TODO: module 1 taught material should be brief so that hands on happens soon – could move some material to later on.

Page 4: Building services in WSRF

WSRFWSRF is a framework consisting of a number of standards. Resource Properties * Lifetime management * Service Groups Notification Faults Renewable References (unpublished)

Other WS specifications such as: WS-Addressing *

* will be talked about in this tutorial

Page 5: Building services in WSRF

How WS-RF fits in with other web service standards.

TODO: chart with WSDL and SOAP, then WSRF standards on top – maybe a slide in WSRF into material?

Page 6: Building services in WSRF

Introduction to GT4 hosting env Describe components

Container (TODO: slide with chart) Clients Build tools

(insert slides from sam’s tutorial here?)

Page 7: Building services in WSRF

WS-Resources Already know what a web service is Web services should be stateless But there is often state in the system A WS-Resource is a representation of some

state that can be accessed through web services

In this tutorial we will be using ‘counter’ resources which are simple accumulators.

Page 8: Building services in WSRF

WS-Resources WSRF specifications provide:

XML-based Resource Properties Lifetime management (creation/destruction) of

resources Servicegroups, which group together WS-

Resources Notification

(for example of changes in resource properties) Faults Renewable References

Page 9: Building services in WSRF

Web service

Web service

Page 10: Building services in WSRF

Web service with WS-Resource

Page 11: Building services in WSRF

Web Service with WS-Resources

Page 12: Building services in WSRF

Web Service with WS-Resources

WS-Resources

Page 13: Building services in WSRF

Examples of what could be a WS-Resouce?

Files on a file server Rows in a database Jobs in a job submission system Accounts in a bank

In this tutorial, each resource is a counter.

Page 14: Building services in WSRF

Files used in the exercise WSDL and XML Schema:

Counter port type

Java CounterService.java CounterHome.jav Counter.java

Build.xml Tells Ant how to build and deploy the code

Page 15: Building services in WSRF

Exercise 1 Exercise: stand up supplied installation and check it

works.

Steps: Install software.

Start the container. ant startContainer

Interact with container show-counter – shows the value in the counter increment-counter – increases value of counter

Page 16: Building services in WSRF

DO EXERCISE AT THIS POINT

Page 17: Building services in WSRF

C

Exercise 1 overviewOne host (your own machine)One web service running on own machineOne counter resource, which will already existClient running on own machine Counter service

One counter resourceContainer

Client

Page 18: Building services in WSRF

C

Exercise 1 overview

Counter service

One counter resourceContainer

ant startContainer

Starts up container, with counter service and a single counter resource.

Page 19: Building services in WSRF

C

Exercise 1 overview

Counter service

One counter resourceContainer

Client

show-counter andincrement-counter clients interact with the resource through the web service.

Page 20: Building services in WSRF

Module 2 – Resource Addressing Endpoint References

TODO: counter service should initialise with two counter resources by default (or part of exercise is to modify code to do this? This is probably better)

Page 21: Building services in WSRF

Why? Need some way to refer to web services

and WS-Resources from anywhere on the network.

Page 22: Building services in WSRF

Endpoint References WS-Addressing specification An Endpoint Reference (EPR) points to a

web service by including a URL.

Page 23: Building services in WSRF

Endpoint References WS-Addressing specification An Endpoint Reference (EPR) points to a

web service by including a URL.

TODO: paste in example EPR here

Page 24: Building services in WSRF

Endpoint References WS-Addressing specification An Endpoint Reference (EPR) points to a

web service by including a URL. EPRs can also contain extra information For WSRF, include ReferenceProperties

that identify a resource

Page 25: Building services in WSRF

Endpoint References WS-Addressing specification An Endpoint Reference (EPR) points to a

web service by including a URL. EPRs can also contain extra information For WSRF, include ReferenceProperties

that identify a resource TODO: paste EPR with RefProps

Page 26: Building services in WSRF

A WSRF conformant EPR contains: URL of web service Key to resource for that service Possibly other information

Security Renewable References

Page 27: Building services in WSRF

Exercise 2 Exercise 2a: talk to second counter on own

machine Using local-b.epr

Exercise 2b: talk to someone else’s service on a different laptop Using other.epr

Use same clients as before, but specifying an EPR file

Should be able to run all of the clients against any machine.

Page 28: Building services in WSRF

Exercise 2 scenarioTwo hosts (your own machine and your friend’s machine)One web service running on friend’s machineOne counter resource on friend’s machineClient running on your own machine

Page 29: Building services in WSRF

Exercise 2 scenarioClient can talk to everyone’s servers – so the situation in this room looks more like this.

Page 30: Building services in WSRF

Module 3 – Resource Properties Resources have Resource Properties Use of XML Resource Properties element in WSDL Querying Resource Properties

Page 31: Building services in WSRF

Why? Resources represent state Often we want to inspect that state

In this tutorial, we want to know the value stored in each counter (the show-counter client)

Page 32: Building services in WSRF

XML based Each resource has a Resource Properties

document. Defined in XML schema Each element in the Resource Properties

document is a Resource Property (RP).

Page 33: Building services in WSRF

Ways to access RPs Pull

Client can query the RP document GetResourceProperty GetMultipleResourceProperties QueryResourceProperties

Push Allows services to send changes in their

resources’ RPs to interested parties. WS-Notification Not covered in this tutorial

Page 34: Building services in WSRF

Pull operations GetResourceProperty

Requests a single resource property by name

GetMultipleResourceProperty Requests several resource properties (from

the same resource) by name QueryResourceProperties

More advanced queries against RP document.

eg. XPath

Page 35: Building services in WSRF

Exercise 3 Exercise: add a resource property to the

service to give ‘last incremented time’. Modify ‘show-counter’ to query this RP.

Query own counters and query other peoples’ counters.

If time, can add another RP of own choice. settable message some other statistic such as ‘number of

times queried’ counter creation time

Page 36: Building services in WSRF

Module 4 – Resource Lifetime Creating new resources Destroying old resources Soft-state lifetime management

Page 37: Building services in WSRF

Why? Resources come and go

For example: jobs in a batch submission system could be

represented as resources submitting a new job causes a new resource

to be created when the job is completed, the resource

goes away

Page 38: Building services in WSRF

Creating new resources Factory pattern A web service operation causes a new

resource to come into existence.

For example, in job submission: submit(JobDescription)

Page 39: Building services in WSRF

Destroying resources Two ways:

Immediate Destruction Scheduled Destruction

Page 40: Building services in WSRF

Immediate destruction Destroy the resource now!

Destroy operation

Page 41: Building services in WSRF

Scheduled Destruction Scheduled destruction allows soft

management of state. TerminationTime RP Keep state alive for as long as we need it,

by calling SetTerminationTime operation periodically.

Page 42: Building services in WSRF

Scheduled Destruction Remote service is ‘self-cleaning’

old unwanted state gets cleaned up automatically if no-one keeps it alive

Problem: if interested party is disconnected from network for a long time, then it cannot extend lifetime and state may be cleaned up prematurely.

Page 43: Building services in WSRF

Soft-state

time

TODO

Page 44: Building services in WSRF

Exercise 4 Exercise: create new counters. Destroy old

counters. Two new clients:

make-counter destroy-counter

Page 45: Building services in WSRF

Exercise 4 scenarioCreated new countersDestroyed existing counters

Page 46: Building services in WSRF

A Brief Overview of the rest of WS-RF WS-Resource Properties * WS-Resource Lifetime * WS-Servicegroups WS-BaseFaults WS-Renewable References WS-Notification

* already covered

Page 47: Building services in WSRF

WS-ServiceGroups TODO

Page 48: Building services in WSRF

WS-BaseFaults TODO

Page 49: Building services in WSRF

WS-Renewable References TODO

Page 50: Building services in WSRF

WS-Notification A group of 3 standards Can deliver notifications of events For example, change in value of a resource

property

Page 51: Building services in WSRF

fin