1 / 51

Building services in WSRF

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.

sidone
Download Presentation

Building services in WSRF

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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

  3. 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.

  4. WSRF WSRF 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

  5. 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?

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

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

  8. 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

  9. Web service Web service

  10. Web service with WS-Resource

  11. Web Service with WS-Resources

  12. Web Service with WS-Resources WS-Resources

  13. 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.

  14. 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

  15. 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

  16. DO EXERCISE AT THIS POINT

  17. 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 C Counter service Client One counter resource Container

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

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

  20. 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)

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

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

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

  24. 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

  25. 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

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

  27. 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.

  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 • Resources have Resource Properties • Use of XML • Resource Properties element in WSDL • Querying Resource Properties

  31. 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)

  32. 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).

  33. 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

  34. 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

  35. 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

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

  37. 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

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

  39. Destroying resources • Two ways: • Immediate Destruction • Scheduled Destruction

  40. Immediate destruction • Destroy the resource now! • Destroy operation

  41. 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.

  42. 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.

  43. Soft-state time TODO

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

  45. Exercise 4 scenario Created new counters Destroyed existing counters

  46. 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

  47. WS-ServiceGroups • TODO

  48. WS-BaseFaults • TODO

  49. WS-Renewable References • TODO

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

More Related