Lecture Notes course 02267 Software Development of Web Services

laboredbumbaileyΛογισμικό & κατασκευή λογ/κού

7 Ιουν 2012 (πριν από 5 χρόνια και 2 μήνες)

668 εμφανίσεις

Lecture Notes course 02267
Software Development of Web Services
Hubert Baumeister
hub@imm.dtu.dk
Fall 2011
Contents
1 Web Service Coordination 1
1.1 What is Coordination.........................................1
1.2 Modeling Conversations.......................................6
2 FromCoordination to Composition 10
3 Summary 14
4 Project Introduction 15
Recap
1 Web Service Coordination
1.1 What is Coordination
Business Process
1
Business Process involving client,supplier,and shipper
Papazoglou,Web services,2008
Composition View
2
The supplier represents a composed Web service
Coordination View
3
The interaction of the client,supplier,and shipper is the focus of Web service coordination
Composition/Orchestration
4
Composition/orchestration
• describes how a Web service is constructed fromother Web services (internal view)
• is controlled by a central entity (e.g.the Composition engine):Conductor
Coordination/Choreography
Coordination/Choreography
• describes how Web services interact (external view)
• In principle not controlled,each participant agrees to play its part (but →conversation controller)
• Each Web service in a coordination can be again based on a composition of Web services
Coordination
• Business processes require complex interaction between participants
– Usually more than just a single Web service call
• Interactions are schematic
– Participants need to adhere to a protocol (exchange of messages)
• Problems
– Modelling coordination protocols
– Enforcing coordination protocols
5
Classification of protocols
Definitions
Conversation
A conversation is a dialog (i.e.message exchange) between several participants (Web services/clients)
Coordination protocol
A coordination protocol describes the set of admissable conversations.
Role
• A Web service/client plays a role in the coordination protocol.
• On participant can play several roles.
1.2 Modeling Conversations
How to specify coordination protocols?
• Concepts
– State machine
– Activity diagram
– Collaboration diagram(single conversations)
– Sequence diagram(single conversations)
∗ Note that collaboration diagrams and sequence diagrams,in general,model only single conversa-
tions
∗ Multiple conversations are modelled with sets of sequence/collaboration diagrams
• Languages for WS protocols
– BPEL (abstract processes) (view is focused on one of the partners)
– WS-Choreography Description Language (WS-CDL http://www.w3.org/TR/ws-cdl-10/)
6
State Machines
Quote received
receive quote
/reply quotes
Quote sent
Goods ordered
receive order goods
Order canceled
Order completed
receive cancel order
receive make payment
• States are the states of the protocol after sending a message or receiving a message
• Transitions describe the activities being performed (e.g.sending or receiving a message)
State Machines
• Advantages
– Simple representation
– Properties of protocols can be verified using e.g.model checking techniques
– Can model serveral conversations
Collaboration Diagram
• Roles are represented as boxes
• Operation calls are modelled as arrows between the roles
• The arrows are labelled with the operation name and a number expressing the sequence of messages
Example Collaboration Diagram
7
Collaboration Diagram
• Advantages
– Conversations between different participants can be modelled
– Messages between the client and the server and the server and the client can be modelled
• Disadvantage
– One diagramdescribes only one possible conversation.
– To model a protocol,several diagrams are necessary
Example Sequence Diagram
• Roles are boxes with a line indicating the lifeline of the role
• Exchange of messages is modelled by arrows between the lifelines
• The sequence of messages is expressed by their order w.r.t.the lifeline
8
Sequence Diagrams
• Sequence diagrams can be translated into collaboration diagrams and vice versa
→ They share the same advantages and disadvantages of collaboration diagrams
• Advantages
– Conversations between different partners can be modelled
– Messages between the client and the server and the server and the client can be modelled
• Disadvantage
– One diagramdescribes only one possible conversation.
– To model a protocol,several diagrams are necessary
• However,some sequence diagram notations provide notations to also model several sequences in one se-
quence diagram
Activity Diagram
• ”Swimlanes” are used for the different roles
– Boxes describe actions denoting message sends and receipts
• Arrows between boxes describe the sequence of actions and alternative paths
Activity Diagrams
• Advantages
– Intuitive
– Conversations between different partners can be modelled
– Messages between the client and the server and the server and the client can be modelled
9
2 FromCoordination to Composition
Coordination can be used to derive Composition
• Coordination protocols can be used to derive skeleton processes
• These processes can then be extended to the real composed Web services
• Advantage
– Composite process obeys coordination protocol
Coordination Protocol:Procurement Process
FromCoordination to Composition I
10
Coordination protocol
11
Extracted abstract process
FromCoordination to Composition II
12
Executable process based on the abstract process (I)(II)
13
3 Summary
Summary:Coordination
• Coordination/Choreography looks on how Web services interact froman external viewpoint
– Coordination protocols describe the rules for Web service interaction
– Partners have to adhere to that protocol
14
– Horizontal protocols
∗ Protocols applicable to several application domains
– Vertical protocols
∗ Relevant for one specific application domain
• Composition/Orchestration looks on Web services interaction fromthe inside of one Web service
• One can derive a composition froma given coordination
4 Project Introduction
Examproject introduction
TravelGood
TravelGood is a travel agency allowing to create and book itineraries.
• TravelGood is a travel agency providing Web services for
– planning trips:allows to create an itinerary
– booking trips:books the flights and hotels in an itinerary
– cancel trips:cancels all bookings in an itinerary
• Trips consists of flights and hotels
– possible serveral flighs and hotels
– flights are always one-way
• TravelGood works together with
– Airline Reservation Agency:LameDuck and CheapBird
– Hotel Reservation Agency:NiceView
– Bank:FastMoney
∗ will be provided at http://fastmoney.imm.dtu.dk:8080
Example conversation:plan trip

• Note that it should be possible to plan a trip with serveral flights and hotels (best intermixed)
15
Example conversation:book trip
Example conversation:cancel trip
Tasks
1 Write a section on Web services
2 Show the coordination protocol between the client and the travel agency as a state machine
3 Implement the Web services fromthe previous slide
– Define the appropriate data structures
– The services of the TravelAgency have to be implemented in BPEL
– The services of the HotelAgency and TravelAgencies can be implemented in BPEL,Java,or any other
programming language (e.g.C#)
16
4 Create the JUnit tests testing the major behaviour of the planning,booking and canceling
5 Web service discovery
– Create WSIL files describing the services each company offers
6 Advanced Web service technology
– Discuss the use of the following Web standards for your services
∗ WS-Addressing,WS-Reliable Messaging,WS-Security,and WS-Policy
General remarks
• For simplicity one can assume that LameDuck and CheapBird use the same service implementation but with
different data.
• The implementation can be done using Java with NetBeans but also using any other Web service technology,
e.g..Net
– However BPEL must be used for composite Web services
• All your Web services should be running and have the required JUnit tests —or xUnit for other program-
ming languages,e.g NUnit for.Net
• During the project presentations you may be asked to show the running systemby executing the clients
• It might be helpful do use some helper services in BPEL processes to do complicated computations.
– However these helper services are not allowed to call Web services if the helper service is not written
in BPEL
Structure of the report
• Introduction
• Introduction to Web services
• Coordination Protocol
• Web service implementations
– A section for the data structures used
– A section for each service
• Web service discovery
• Advanced Web service techology
• Conclusion
• Important:No appendices
Reporting:Web service implementations
• Each Web service should have a short description of what it does and how it is implemented
• BPEL processes
– graphical representation of the BPEL process in an understandable way (e.g.you can use several
diagrams for showing a BPEL process,e.g.one for the overall structure and others for the details)
∗ There is a feature in the BPEL designer of Netbeans to hide details
17
What needs to be delivered?
• Report (report
xx.pdf)
• ws
xx.zip
– Simple services:WSDL files,XSD files
– Complex services:WSDL files,XSD files,BPEL files
– WSIL files
– author.txt
• application
xx.zip
– Source code projects (e.g.NetBeans projects) of the application so that I can deploy and run the
projects
– Implemented Web services
∗ Simple services
∗ Complex services (BPEL)
• deploy
xx.zip
– containing the war files for the Java Web services,the zip files for the BPEL Web services and jar files
plus a lib directory for the JUnit tests
→ all of these are found in the dist directory of the various Netbeans projects
Important:Who did what in the project
• It is important that with each section/subsection it is marked who is responsible for that part of the text.
• There can only be one responsible person for each part of the text.
• In addition,each WSDL,XSD,BPEL,Java,...file needs to have an author.
• Who is author of which file should be listed in author.txt file in ws
xx.zip
• Make sure that each member of the group does something of each task!
• Note that you all are responsible that the overall project looks good
– Teamwork is among the learning objectives
– Don’t think:”I am not responsible for this part,so I don’t have to care how this part looks and
contributes to the whole”
General tips
• It is likely to get better grades if you all work together and everybody is in fact responsible for every part in
the report
• Prioritize high risk task:Don’t put of high risk tasks (like doing the BPEL processes) to the end of the
project
– Not so good:XML schema,WSDL file,Simple Web services,BPEL processes,Test
– Better:work by user stories:book trip successful (Test,XML schema,WSDL file,Simple Web
services,BPEL process),book trip with errors (...),cancel trip successful (...),...
• Try to avoid waiting for each other
– ”I can’t do the WSDL files,because I amwaiting for the other guy doing the XML schemata first”
18
Schedule
• Forming of project groups happens now
• A group for each project group on CampusNet will be created
• Project starts today and finishes Tuesday morning 29.11.10 08:00
• Submission of the four files to the respective file section on CampusNet
• Project presentations will be Monday 12,Tuesday 13,and Wednesday 14.12:participation is mandatory
• Help
– Regarding the problemdescription
– Technical help
∗ Exercise sessions after the lecture will continue through the project period and can be used for
technical questions and problemclarifications
∗ Please also send your Netbeans projects if you write an e-mail
19