Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Building services in WSRF Ben Clifford Draft 2004-07-09 For GGF summer school, July 2004."— Presentation transcript:

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

2 outline l Webservices – should be covered by EGEE, so just one slide of concepts, eg. WSDL without further expl. l WSRF – what WSRF adds – do we need to discuss why or will that be covered in earlier sections? Eg. Carl’s intro? l Introduce WS-Resource l WS-Resource Properties l Exercise: stand up supplied installation and get running (maybe before WS-Resource intro) l Exercise: talk to someone else’s service on a different laptop l 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. l Exercise: lifetime management: create new counters. Destroy old counters. l 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) l 2 hours exercise = 60 slides = 15 slides per module

3 Module 1 l Overview l WSRF l Globus Alliance WSRF implementation l TODO: module 1 taught material should be brief so that hands on happens soon – could move some material to later on.

4 WSRF WSRF is a framework consisting of a number of standards. l Resource Properties * l Lifetime management * l Service Groups l Notification l Faults l Renewable References (unpublished) Other WS specifications such as: l WS-Addressing * * will be talked about in this tutorial

5 How WS-RF fits in with other web service standards. l TODO: chart with WSDL and SOAP, then WSRF standards on top – maybe a slide in WSRF into material?

6 Introduction to GT4 hosting env l Describe components u Container (TODO: slide with chart) u Clients u Build tools l (insert slides from sam’s tutorial here?)

7 WS-Resources l Already know what a web service is l Web services should be stateless l But there is often state in the system l A WS-Resource is a representation of some state that can be accessed through web services l In this tutorial we will be using ‘counter’ resources which are simple accumulators.

8 WS-Resources l WSRF specifications provide: u XML-based Resource Properties u Lifetime management (creation/destruction) of resources u Servicegroups, which group together WS- Resources u Notification l (for example of changes in resource properties) u Faults u Renewable References

9 Web service

10 Web service with WS-Resource

11 Web Service with WS-Resources

12 WS-Resources

13 Examples of what could be a WS- Resouce? l Files on a file server l Rows in a database l Jobs in a job submission system l Accounts in a bank l In this tutorial, each resource is a counter.

14 Files used in the exercise l WSDL and XML Schema: u Counter port type l Java u CounterService.java u CounterHome.jav u Counter.java l Build.xml u Tells Ant how to build and deploy the code

15 Exercise 1 l Exercise: stand up supplied installation and check it works. l Steps: u Install software. u Start the container. l ant startContainer u Interact with container show-counter – shows the value in the counter increment-counter – increases value of counter

16 l DO EXERCISE AT THIS POINT

17 C Exercise 1 overview One host (your own machine) One web service running on own machine One counter resource, which will already exist Client running on own machine Counter service One counter resource Container Client

18 C Exercise 1 overview Counter service One counter resource Container ant startContainer Starts up container, with counter service and a single counter resource.

19 C Exercise 1 overview Counter service One counter resource Container Client show-counter and increment-counter clients interact with the resource through the web service.

20 Module 2 – Resource Addressing l Endpoint References l 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)

21 Why? l Need some way to refer to web services and WS-Resources from anywhere on the network.

22 Endpoint References l WS-Addressing specification l An Endpoint Reference (EPR) points to a web service by including a URL.

23 Endpoint References l WS-Addressing specification l An Endpoint Reference (EPR) points to a web service by including a URL. l TODO: paste in example EPR here

24 Endpoint References l WS-Addressing specification l An Endpoint Reference (EPR) points to a web service by including a URL. l EPRs can also contain extra information l For WSRF, include ReferenceProperties that identify a resource

25 Endpoint References l WS-Addressing specification l An Endpoint Reference (EPR) points to a web service by including a URL. l EPRs can also contain extra information l For WSRF, include ReferenceProperties that identify a resource l TODO: paste EPR with RefProps

26 l A WSRF conformant EPR contains: u URL of web service u Key to resource for that service u Possibly other information l Security l Renewable References

27 Exercise 2 l Exercise 2a: talk to second counter on own machine u Using local-b.epr l Exercise 2b: talk to someone else’s service on a different laptop u Using other.epr l Use same clients as before, but specifying an EPR file l Should be able to run all of the clients against any machine.

28 Exercise 2 scenario Two hosts (your own machine and your friend’s machine) One web service running on friend’s machine One counter resource on friend’s machine Client running on your own machine

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

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

31 Why? l Resources represent state l Often we want to inspect that state l In this tutorial, we want to know the value stored in each counter u (the show-counter client)

32 XML based l Each resource has a Resource Properties document. l Defined in XML schema l Each element in the Resource Properties document is a Resource Property (RP).

33 Ways to access RPs l Pull u Client can query the RP document l GetResourceProperty l GetMultipleResourceProperties l QueryResourceProperties l Push u Allows services to send changes in their resources’ RPs to interested parties. l WS-Notification l Not covered in this tutorial

34 Pull operations l GetResourceProperty u Requests a single resource property by name l GetMultipleResourceProperty u Requests several resource properties (from the same resource) by name l QueryResourceProperties u More advanced queries against RP document. u eg. XPath

35 Exercise 3 l Exercise: add a resource property to the service to give ‘last incremented time’. Modify ‘show-counter’ to query this RP. l Query own counters and query other peoples’ counters. l If time, can add another RP of own choice. u settable message u some other statistic such as ‘number of times queried’ u counter creation time

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

37 Why? l Resources come and go l For example: u jobs in a batch submission system could be represented as resources u submitting a new job causes a new resource to be created u when the job is completed, the resource goes away

38 Creating new resources l Factory pattern l A web service operation causes a new resource to come into existence. l For example, in job submission: u submit(JobDescription)

39 Destroying resources l Two ways: u Immediate Destruction u Scheduled Destruction

40 Immediate destruction l Destroy the resource now! Destroy operation

41 Scheduled Destruction l Scheduled destruction allows soft management of state. TerminationTime RP Keep state alive for as long as we need it, by calling SetTerminationTime operation periodically.

42 Scheduled Destruction l Remote service is ‘self-cleaning’ u old unwanted state gets cleaned up automatically if no-one keeps it alive l Problem: if interested party is disconnected from network for a long time, then it cannot extend lifetime and state may be cleaned up prematurely.

43 Soft-state time TODO

44 Exercise 4 l Exercise: create new counters. Destroy old counters. u Two new clients: l make-counter l destroy-counter

45 Exercise 4 scenario Created new counters Destroyed existing counters

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

47 WS-ServiceGroups l TODO

48 WS-BaseFaults l TODO

49 WS-Renewable References l TODO

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

51 fin


Download ppt "Building services in WSRF Ben Clifford Draft 2004-07-09 For GGF summer school, July 2004."

Similar presentations


Ads by Google