• Ingen resultater fundet

02267: Software Development of Web Services

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "02267: Software Development of Web Services"

Copied!
31
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

02267: Software Development of Web Services

Introduction

Hubert Baumeister huba@dtu.dk

Department of Applied Mathematics and Computer Science Technical University of Denmark

January 2019

(2)

Contents

Why Services?

Why Web Services?

Demo

Learning Objectives Practical Information

(3)

What is this Course About?

I Topics

I Web services

I Microservices

I Service-oriented Architecture (SOA)

I 5 ECTS points

I Complementary courses

I 02220 on distributed systems

(4)

Example: Purchase Order: Business Process

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

(5)

Business Processes within a company

(6)

Business Process across companies (B2B)

(7)

Example: Purchase Order: Service Orientation

The customer wants to purchase some goods (via the Internet) 1. Customer contacts the supplier’s 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 customer’s credit

4. The process sales service calls the check inventory service to check if the goods are on stock

I . . .

(8)

(Web) Service architecture

Business logic / Business processes Web services

W e b S e r v i c e s

Business logic / Business processes

Database Access Layer

DB

DB Database Access L.

Web App Mobile App

Company 1 Company 2

(9)

Example: Purchase: Service Oriented Architecture (SOA)

I The IT systems of each department offer services

simple (Web) services

I 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

(10)

Service-Oriented Architecture (SOA)

I A set of principles for organising the software

I Not restricted to the use of Web services

I Web services

I OSGi services

I Grid services

I Cloud services

I . . .

(11)

SOA Principles (I)

I Loose coupling

I Services represent self contained units of logic (one function or a set of functions) which are relatively independent

Resusability

I Discoverablity

:Service Registry

:Service Provider :Client

(12)

SOA Principles (II)

I Abstract service description (independent of implementation)

I Encapsulation (autonomy and abstraction)

I Compositionality

I And additional for Web services

I Based on open standards

I Vendor neutral / vendor diversity

(13)

Service invocation vs. function call

Function call

I Within the same process

I Function is always available

I Takes almost no time

I Focus on single calls

→ Fine grained

→ Tight coupling

→ Simple data as parameters

Service invocation

I Across processes, computers, networks

I Takes time (several magnitudes more than a function call)

I May fail

I Several service invocation may form a dialog

→ Coarse grained

→ Loosely coupled

→ Complex data, documents,

(14)

Contents

Why Services?

Why Web Services?

Demo

Learning Objectives Practical Information

(15)

Why Web Services?

I Problem: finding a standard way to communicate

I Previous: Java RMI, .COM, DCOM, CORBA, . . .

I Different access ports and protocols

I Solution

(16)

Web services to the rescue

I They reuse existing infrastructure for Web applications

Web servers

HTTP, CGI-bin, Servlet architecture, . . .

I Exchange format is simple text messages (SOAP, JSON, . . . )

I Don’t return HTML but SOAP, XML, JSON, . . .

Easy to parse and construct (reuse XML parsers)

I Crosses company boundaries easy: port 80 with standard Web servers

(17)

Success of Web services . . .

I SOAP is based on XML

I SOAP messages have a simple structure:

<soapenv:Envelope>

<soapenv:Body>

<ns1:srrequest>

<ns1:action>register</ns1:action>

<ns1:student>

<ns1:name>S˜A¸ren Helmersen</ns1:name>

</ns1:student>

</ns1:srrequest>

</soapenv:Body>

</soapenv:Envelope>

I SOAP messages are transported by HTTP or SMTP

(18)

. . . Consequences . . .

→ It is easy to generate SOAP messages

→ Only an 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

(19)

. . . But

I Message contents / data encoding is not standardised

I WSDL and XML Schema help with that

I Simple messaging model: Support needed, e.g., for

I Security

I Meta information (Authorization, Authentification, Dialogs, . . . )

I . . .

(20)

Summary: What are Web services?

I A technique such that onecomputing device offers services to another computing deviceusing standard internet protocols (i.e. HTTP, SOAP, XML, . . . )

I Not to be confused with Web sites/Web applications, though they may use Web services

(21)

Uses of Web services

I Provides business logic of Web applications

I Google, Twitter, . . . provide public Web services

I Provide the connection to the server for mobile applications

I Request and store data from the server

I Request computations (like route calculations, image manipulations, . . . )

I Offers business services and automates buisness processes

I Within a company / across companies (Business to Business B2B)

(22)

Types of Web services

I SOAP-based Web services

I Use HTTP protocol to exchanged SOAP messages (special type of XML)

I SOAP messages, however, are independent of HTTP (one possible transport protocol)

I Based on the concept of services as functions

Used with B2B applications

I REST

I Use the concepts behind HTTP

Resources, URL’s identifying resources

Representations defined by Mime-Types: XML, JSON, Text, HTML, . . .

HTTP Verbs: GET, POST, PUT, and DELETE are functions on resources

Used with mobile applications and Web applications

(23)

Contents

Why Services?

Why Web Services?

Demo

Learning Objectives Practical Information

(24)

Demo: Order Service Web Service

1. Creating a simple OrderService Web service in Java 2. Deploying the Web service on a Web server (GlassFish) 3. Calling the Web service from Java

4. Calling the Web service with Google Chrome and the Postman app

(25)

Order Process BPEL

Example for a composite Web service 1 Receive an order

2 Receive payment information

3 Initiate shipment by calling the shipment service

orderRe...

receive...

pay

cancelO...

orderProcess

Process Start

Process End ReceiveOrder

Sequen...

OrderRe...

Sequenc...

Reply

Payment

OnMessage

Message DoPayment

Sequence6 Scope1

ShipOrder OnAlarm

Timer NoPaym...

PartnerL...

shipOrder

cancelS...

orderProcess

25

(26)

Contents

Why Services?

Why Web Services?

Demo

Learning Objectives Practical Information

(27)

Learning objectives

I Creating and calling simple SOAP-based Web services

I Bottom Up: Service class first

I Top Down: Service description in the Web Service Description Language (WSDL) first

I Using XMLSchema to represent complex datatypes

I Automating Business Processes as Web services

I Composition and coordination of Web services

I Business Process Execution Language (BPEL)

I Addressing specific problems of SOAP-based Web services

I e.g. Reliability of message exchange, security (privacy and authenticity), . . .

I Implementing and calling RESTful Web services

I Simple Web services

I How to model business processes with RESTful services What is the difference between SOAP-based and RESTful

(28)

Contents

Why Services?

Why Web Services?

Demo

Learning Objectives Practical Information

(29)

Course Prerequisites

I Programming language: Java

I Operating system knowledge

I Examples and exercises use Unix (Linux / FreeBSD), Mac, or Windows

I Software needs to be installed

I Shell commands; Shell-scripts need to be written or adapted

I Basic knowledge of Internet technologies: XML, HTML, Sockets, TCP, ...

(30)

Practical Information I

Workload: 5 ECTS

I corresponds to

approximately 9 hours / day

Daily Schedule

How to reach me:

I huba@dtu.dk Course Web Page

I http://www.imm.dtu.

dk/courses/02267 CampusNet Messages

I Make sure you get CampusNet messages and check them

(31)

Grading

1. Project work

I Teams of 6 (Team building today)

I Implementing software using a Microservice architecture

I Writing a report

2. Project presentation by the project teams

I Thursday + Friday (24.1 – 25.1.)

Referencer

RELATEREDE DOKUMENTER

service tries to distinguish itself from the others by developing proprietary content, the most widespread use of on-line services including the Internet is electronic mail,

In this study, we review the status of research on the internationalisation of services and service firms in the international business domain in order to derive questions

The case studies indicate, that the service concept within IT services consists of (at least) four components: The organisation of the service provided, the nature of the

Users still use faving as a bookmarking tool, sometimes as a trigger for web bookmarking services like Pinboard using IFTTT (a web application that uses changes in web applications

This paper will explore the interaction between these two levels of commodification trying to explicate how the nature of venture capital plays role in the type of Internet

If Internet technology is to become a counterpart to the VANS-based health- care data network, it is primarily neces- sary for it to be possible to pass on the structured EDI

This enhanced management of one’s system infrastructure is one of the key advantages of using a Cloud Computing service, such Amazon Web Services, for hosting multi-tier

Ved at se på netværket mellem lederne af de største organisationer inden for de fem sektorer, der dominerer det danske magtnet- værk – erhvervsliv, politik, stat, fagbevægelse og