Вы находитесь на странице: 1из 34

SOA Basic Concepts

TEMENOS EDUCATION CENTRE


Warning: This document, is protected by copyright law and international treaties. No part of this document
may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of TEMENOS HEADQUARTERS SA Unauthorized
reproduction or distribution of this presentation or any portion of it, may result in severe civil and criminal
penalties, and will be prosecuted to the maximum extent possible under applicable law. Information in this
document is subject to change without notice

Objectives

At the end of this session you will be able to

Describe the need for SOA


Name the technologies used to create a web service
Create and consume a simple webservice

Slide 2

What is SOA?

SOA

Slide 3

SOA

Service Oriented Architecture


SOA is a way of software development based on well defined services

Service Oriented Architecture is a


paradigm for organising and utilising
distributed capabilities that may be under
the control of different ownership domains.
It provides a uniform means to offer,
discover, interact with and use capabilities
to produce desired effectives consistent
with measureable preconditions and
expectations. (OASIS)

Services
Postal Services

Transport Services

Housekeeping Services

Slide 5

Example

Internet Store
Book orders

Payment

Slide 6

SOA key features

SOA
Services

Interoperability

Loose
coupling

Slide 7

Service Architecture 1

Service request

Provider

Consumer
Service response

Service Architecture 2

Registry

Find

Register

Consumer

Provider
Bind and Invoke

SOA and technology

Resources are made available as independent services


Service may be accessed without knowledge of their underlying
platform implementation
Implemented using a wide range of technologies, including REST,
RPC, DCOM, RMI, CORBA, WCF or Web Services

REST
Representational State Transfer
RPC
Remote Procedure Calls
DCOM
Distributed Component Object Model
RMI
Remote Method Invocation
CORBA Component Object Request Broker Architecture
WCF
Windows Communication Foundation
Web Services Also called XML Web Services to differentiate from REST web
services

Webservices

WEBSERVICES

Slide 11

What is a Webservice?
Formal Definition

A software system designed to support interoperable Machine to


Machine interaction over a network (W3C)

The term Web services describes a standardized way of integrating


Web-based applications using XML based open standards over an
Internet protocol backbone (from webopedia.com)

Services are what you connect together using Web Services

Web Services refers to the technologies that allow for making


connections

Web Service also can be explained as a method on a system that can


be invoked remotely from another system (consumer) using web
technologies

A simpler definition

Web services are not necessarily use by humans.

Why? They normally do not have a visual interface

Web services are a standard way for computers on the internet to


publish access to program functions that they want to allow other
computers to use.

That is a web service must be invoked like a function in a computer


program.

Slide 13

Lets write a webservice (java)


package com.temenos.calc;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@WebService
public class FirstService {
@WebMethod(action=Add")
public int Add(int a, int b)
throws AddNumbersException {
if (a < 0 || b < 0) {
throw new AddNumbersException(
"Negative number cant be added!",
"Numbers: " + a+ ", " + b);
}
return a + b;
}
}
Slide 14

A webservice

A webservice has methods (functions) which may called over the web
The sample webservice

is called FirstService
has one method called Add

Slide 15

But web services are meant to be called by software

Web services are meant to be called by other software


But , how do other software call a webservice?

Slide 16

Calling a webservice

To call a webservice, you need to know

Its location: where is the service located?


Its interface: its methods, method signatures, and return values
The transport protocol : what protocol does the service understand?
The message protocol: what format does the message follow?

Slide 17

Web Services described

XML Web service is a software service


exposed on the Web through SOAP,
described with a WSDL file and
registered in UDDI.

18

Web Services Building Blocks

Discovery

UDDI, DISCO
Description

WSDL
Message Format

SOAP

Encoding
XML, schemas

Transport

HTTP, SMTP,

19

WSDL

SOAP?

20

Before we start.
Let us be clear on what is meant by
XML
Xtensible Markup Language. May be used to describe whatever you want.
You attach meanings to the tags.

DTD or Schema
Document Type Definition. To describe to others what tags are allowed in our
particular XML document, and in what structure we would expect to find them.
i.e. they are mechanisms for validating the XML.

Schema and SOAP


Simple Object Access Protocol. It is a specific format of XML.

Schema and WSDL


Web Services Description Language. It is a specific format of XML.

Slide 21

WSDL

A WSDL service description is the XML grammar and vocabulary to


describe a Web service.

W3 definition
WSDL is an XML format for describing network services as a set of
endpoints operating on messages containing either document-oriented
or procedure-oriented information. The operations and messages are
described abstractly, and then bound to a concrete network protocol
and message format to define an endpoint. Related concrete endpoints
are combined into abstract endpoints (services).

Slide 22

WSDL

If you type the URL of a webservice followed by ?wsdl you would get
something like this

Slide 23

SOAP

SOAP?

24

What can we do with SOAP?

Exchange messages

SOAP is a specification that defines the XML format for messages

Defines an XML structure

to call a method on a remote machine and pass arguments


To return values
To return error messages (if any)

What can we do with SOAP?

25

What makes up SOAP ?

Envelope package
Header/Body pattern

Similar to how HTTP works

Header
Body
Payload

26

Simple Example
<Envelope>
<Header>
<transId>345</transId>
</Header>
<Body>
<Add>

c = Add(a, b)

<a>3</a>
<b>4</b>
</Add>
</Body>
</Envelope>

27

SOAP Elements

Envelope (mandatory)

Top element of the XML document representing the message

Header (optional)

Determines how a recipient of a SOAP message should process the


message
Adds features to the SOAP message such as authentication, transaction
management, payment, message routes, Security digest etc

28

SOAP elements

Body (mandatory)

Exchanges information intended for the recipient of the message.


Typical use is for RPC calls and error reporting.

29

Quiz

Description

Name it

The ability of diverse systems to work


together
Degree to which software pieces depend on
each other
I am used to describe web services
I am used to describe meanings for XML tags
I am used a protocol for exchanging
structured information

Slide 30

Quiz State True or False

Web services are the only way to implement a SOA


http is the only transport protocol used by SOAP
SOAP is an XML format

Slide 32

Important Points

SOA is a way of software development based on well defined services


A service typically exposes a single, discrete business process
Services may be implemented using different technologies

Webservices has made it popular

Webservice uses XML standards

SOAP
WSDL

References - Books

SOA in Practice (Nicolai Josuttis)


Java Webservices

Slide 35

References - websites

http://servicemix.apache.org/articles.html
www.looselycoupled.com

Slide 36

Вам также может понравиться