You are on page 1of 37

02267: Software Development of Web

Services
Week 1
Hubert Baumeister
huba@dtu.dk
Department of Applied Mathematics and Computer Science
Technical University of Denmark
Fall 2013
Contents
Course Introduction
Course Goal
Practical Information
Distributed IT
Service Oriented Architecture
Web Services
What is this Course About?

Web Services & Service Oriented Architecture

5 ECTS points

Complementary courses

02221/02222 on distributed systems


Goals of this course

Knowledge about

What are Web services and Service-Oriented Architecture


(SOA)

Technologies and standards for Web services

e.g. XML, SOAP, WSDL, . . .

Web service extensions

Able to evaluate

When to use Web services and SOA

What are the problems when using Web services and what
are possible solutions

Able to do

Implementation of Web services (simple and composite)

including writing of XML Schema documents (XSD), WSDL,


BPEL
Topics not addressed in this course

Web services are basically a computer to computer


technology

using technologies also used with Web applications

Therefore, the following topics wont be addressed in this


course

HTML, Content Management Systems, JSON, Javascript,


JSP, ASP, Python, Perl, How servelets work,
MS-Sharepoint, APIs for social networking (i.e.
OpenSocial) or location aware services, OAuth

Other topics not addressed in the course

Connection to databases (e.g. JDBC), Programming


languages like Java or C#
Course Prerequisites

Programming language: Java

Operating system knowledge

Examples and exercises use Unix (Linux / FreeBSD) or


Windows

Software needs to be installed

Shell commands; Shell-scripts need to be written or


adapted

Basic knowledge of Internet technologies: XML, HTML,


Sockets, TCP, ...
Practical Information I

Workload: 5ECTS = 9 hours / week

90min lecture (2 * 45min + 10min break)

90min tutoring sessions

5 hours self study


Additional reading tasks
You need to work on the exercises outside of the tutoring
sessions

Lectures 8:3010:15 on Monday

Tutoring sessions 10:1512:00 in E-Databar: Rooms 003


and 015 in Building 341

Exercises are not mandatory

but help prepare for the exam project


Practical Information II

How to reach me

E-Mail: huba@dtu.dk

Room: 303B/058

Course Web Page

http://www.imm.dtu.dk/courses/02267

Software

Java 6/7 (JDK), OpenESB 2.3 (Netbeans (IDE) and


Glasssh (Application Server))

http://www.open-esb.org
Grading
1. Project work

5 weeks (week 4449)

Teams of 46 (Team building week 44 (participation is


mandatory))

Implementing Web services (simple and composite)

Writing a report
2. Project presentation by the project teams

Project presentation ( 10min) + questions: total 45 min

Dates MondayWednesday week 51 (16 18.12)


Literature

Michael P. Papazoglou, Web services: Principles and


Technolgoy, Pearson Education Limited, 2008

plus additional literature throughout the course


Example: Purchase Order
The customer wants to purchase some goods (via the Internet)
1. Customer contacts the supplier and orders the goods
2. Sales department check with credit card department if
credit is okay
3. Sales department check with inventory department if the
goods are on stock
4. Sales department informs the billing department to bill the
customer
5. Sales department informs the shipment department to
send out the goods
6. Shipment department sends the goods to customer
7. Shipment department informs the billing department to
send the invoice
8. Billing department sends the invoice to the customer
Classical distributed IT (I)

Purchase order is a business process involving different IT


systems

Components in an IT infrastructure

Legacy systems

Application server

Database server

Web server

Clients: Web browser, thin client, fat client

Goal

Automation of business processes

Business processes span all of these systems

Different IT system use different technologies

How to connect all these parts in a uniform way technically


and semantically?
Classical distributed IT (II)

Problems

Different technologies CORBA, EJB, .NET, COM/DCOM

No well dened interfaces

Ad-hoc combination
Classical distributed IT (III)

Solution

Unifying view representing IT to the outside IT world


Service-Oriented Architecture (SOA)

Use Internet standards Web service


Example: Purchase Order II
The customer wants to purchase some goods (via the Internet)
1. Customer contacts the suppliers Web site and orders the
goods
2. The Web site uses the process sales service to actually
order the goods
3. The process sales service contacts the credit card service
to check the customers credit
4. The process sales service calls the check inventory
service to check if the goods are on stock

. . .
Example: Purchase Order III

The IT systems of each department offer services


simple (Web) services

The purchase order business process is itself a service


offered to the customer which uses the services of the
other IT systems
composite (Web) service
Global Computing Challenge (I)

IT integration between IT systems of different companies

Business to Business

Loose coupling

In addition to the problems of a distributed IT infrastructure:

Firewalls: block most of TCP/IP ports for security reasons


SOA (Service Oriented Architecture)

Automate business processes

within a company

across companies
Services (SOA)
Web standards (e.g. XML, HTTP, . . . )
Service-Oriented Architecture (SOA)

A set of principles for organising the software

Not restricted to the use of Web services

Web services

OSGi services

Grid services

Cloud services

. . .
SOA Principles (I)

Loose coupling

Services represent self contained units of logic (one


function or a set of functions) which are relatively
independent
Resusability

Discoverablity
:Service Registry
:Service Provider :Client
SOA Principles (II)

Abstract service description (independent of


implementation)

Encapsulation (autonomy and abstraction)

Compositionality

And additional for Web services

Based on open standards

Vendor neutral / vendor diversity


Service invocation vs. function call
Function call

Within the same process

Function is always
available

Takes almost no time

Focus on single calls


Service invocation

Across processes,
computers, networks

Takes time (several


magnitudes more than a
function call)

May fail

Several service invocation


may form a dialog
Service invocation vs. function call
Function call

Within the same process

Function is always
available

Takes almost no time

Focus on single calls


Fine grained
Tight coupling
Simple data as parameters
Service invocation

Across processes,
computers, networks

Takes time (several


magnitudes more than a
function call)

May fail

Several service invocation


may form a dialog
Coarse grained
Loosely coupled
Complex data, documents,
as parameters
Web Services
Solutions for the global computing problem

Firewalls
Communication via HTTP using XML messages
SOAP

Different technologies

n interfaces (x, y Web services)

instead of n
2
for x y.
Use of Internet standards
Integration Scenario
Basic idea of Web services

Exchange of messages

Messages are encoded using XML


SOAP

Using standard protocols to transport messages


HTTP, SMTP, . . .

Message can be sent:

One-way: Call the service, but dont expect an immediate


answer
asynchronous messaging

Request / response: Call the service and wait for the


response

most common style

synchronous messaging
The history of Web services

Internet (70s, 80s)

Web (90s)

Extensible Markup Language (XML) (98)

Simple Object Access Protocol (SOAP) (2000)

Description of the REST architecture principle behind the


HTTP protocol (Roy Fielding) (2000)

Web Service Description Language (WSDL) (2001)


Success of Web services . . .

SOAP is based on XML

SOAP messages have a simple structure:


<soapenv:Envelope>
<soapenv:Body>
<ns1:srrequest>
<ns1:action>register</ns1:action>
<ns1:student>
<ns1:name>Sren Helmersen</ns1:name>
</ns1:student>
</ns1:srrequest>
</soapenv:Body>
</soapenv:Envelope>

SOAP messages are transported by HTTP or SMTP


. . . Consequences . . .
It is easy to generate SOAP messages
Only a XML parser is needed for parsing the messages
Web server technology can be reused for Web services
(e.g. cgi-bins and servlets)
Easy to provide Web services in any programming
language
Easy to use Web services in any programming language
and operating system
. . . But

Message contents / data encoding is not standardised

WSDL and XML Schema help with that

Simple messageing model: Support needed, e.g., for

Security

Meta information (Authorization, Authentication, Dialogs,


. . . )

. . .
Demo: A simple Web service
1. Creating a simple HelloWorld Web service in Java
prepending Hello to its input
2. Deploying the Web service on a Web server (GlassFish)
3. Calling the Web service from Java
4. Calling the Web service from Ruby
What we are going to study in this course

Message structure: SOAP

Description of Web services: WSDL (Web Service


Description Language)

http://www2.imm.dtu.dk/courses/02267/examples/
week01/WSDL.wsdl

Discovery of Web services: UDDI (Universial Description,


Discovery, and Integration), WSIL (Web Service Inspection
Language)
Web service composition and . . .

How is a Web service constructed from others

Issues

Long running business processes

Transaction: What to do when something goes wrong


Compensation Handler
. . . Web service coordination

How do different Web services play together

Planned Orchestration Web service Composition

Ad-hoc: Each participant has to follow rules


Choreography
Security

Problem: In principle SOAP messages can be read by


anybody and modied by anyone

One possibility is that the transport layer ensures privacy


and authenticy
HTTPS

Other possibility: SOAP message itself contains security


features
WS-Security

Message parts can be encrypted

Message parts can be signed

http://www2.imm.dtu.dk/courses/02267/examples/
week01/security.xml

What parts need to be encrypted and signed?

Other security properties: Trust, . . .


WS-* Standards: Addressing, Reliable
Messaging,Policy, . . .

There are hundreds of standards addressing shortcomings


of the simple WS model

Addressing

SOAP messages itself do not contain information about to


whom the message is addressed or from whom the
message is sent

Reliable Messaging

Reliability depends partly on the transport protocol (e.g.


HTTP partly reliable, SMTP not reliable: messages can be
lost)

Policy

What properties has a Web service: Performance, Cost,


support for WS-security, WS-Addressing, e.t.c.
Contents of the course
1. Introduction to Web services and SOA
2. Basic technologies: XML, XML Schema, . . .
3. Basic Web service technology: SOAP, . . .
4. Describing Web services: WSDL
5. Development of Web Services: Bottom up, top down
development, generating compositions from coordinations,
. . .
6. Finding Web services: UDDI, WSIL, . . .
7. RESTful Web services
8. Composing Web services: BPEL
9. Coordinating Web services: WS-Coordination, WS-CDL,
. . .

Long running transactions: WS-AtomicTransaction,


Compensation, . . .
10. Security: WS-Security, . . .
. . .

You might also like