8 soa technisch perspectief

21
Bas Kruiswijk Leiden 19 May 2010 Service Oriented Architecture Deel 4 – SOA vanuit technisch perspectief

Transcript of 8 soa technisch perspectief

Page 1: 8 soa technisch perspectief

Bas Kruiswijk

Leiden19 May 2010

Service Oriented Architecture

Deel 4 – SOA vanuit technisch perspectief

Page 2: 8 soa technisch perspectief

2© Twynstra Gudde 19-5-2010

Service Oriented Architecture

OverzichtDeel 4: SOA vanuit technisch perspectief

1. Basisconcepten

2. SOA vanuit organisatorisch perspectief

3. Procesbesturing

4. SOA vanuit technisch perspectief

– Service als technisch concept

– Web services

5. De SOA infrastructuur

6. SOA in het ontwerpproces

Page 3: 8 soa technisch perspectief

3© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Services

– From a technical perspective a logical next step followingobject- en component technology

– Broad adoption of (internet)standards for web services

– Platform independant

– Central concept in (almost) alle current software developmentplatforms (for instance the Java and .NET based platforms)

Serviceimplementation

Serviceinterface

Visible service interface description

Invisible, encapsulatedinternal implementation

request

respons

Page 4: 8 soa technisch perspectief

4© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Service

Serviceimplementation

Serviceinterface

Visible service interface description

Invisible, encapsulatedinternal implementation

request

respons

Page 5: 8 soa technisch perspectief

5© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Web services

– Web services are the most common technical implementation of a service

– Web services are not the only possible technical implementation

– Term Web services refers to a collection of standards that coverinteroperability

– Fundamental standards

– XML (eXtensible Markup Language) and XSD (XML Schema Definition)

– HTTP (HyperText Transfer Protocol)

– WSDL (Web Service Definition Language)

– SOAP (Simple Object Access Protocol)

– UDDI (Universal Description, Discovery and Integration)

Page 6: 8 soa technisch perspectief

6© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Fundamental standards for web services (1)HTTP and XML (existed before web services)

Serviceimplementation

Serviceinterface

Visible service interface description

Invisible, encapsulatedinternal implementation

request

respons

XML

XML

HTTP

Page 7: 8 soa technisch perspectief

7© Twynstra Gudde 19-5-2010

Service Oriented Architecture

XML Example<books>

<book><author>Don Box</author><title>Essential XML</title><price>34,95</price>

</book><book>

<author>Linus Torvalds</author><title>Linux for Fun</title><price>34,95</price>

</book></books>

<ClientSuwi><SofiNr>123456789</SofiNr><BankGironr>01982712</BankGironr><TelefoonnrClient>

<Telefoonnr><Netnr>020</Netnr><Abonneenr>4890000</Abonneenr>

</Telefoonnr></TelefoonnrClient>

</ClientSuwi>

– eXtensible Markup Language for data-exchange, -storage and –presentation

– General format, tag-structure

– Most other web services standards (and many others) are based on XML

Page 8: 8 soa technisch perspectief

8© Twynstra Gudde 19-5-2010

Service Oriented Architecture

XML and XSD (XML Schema Definition)Example

– An XML File has a structure

– An XML Schema Definition (XSD) describes this structure

<shiporder orderid="889923"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation=""""shiporder.xsdshiporder.xsdshiporder.xsdshiporder.xsd"""">>>>

<orderperson>John Smith</orderperson><shipto>

<name>Ola Nordmann</name><address>Langgt 23</address><city>4000 Stavanger</city><country>Norway</country>

</shipto><item>

<title>Empire Burlesque</title><note>Special Edition</note><quantity>1</quantity><price>10.90</price>

</item><item>

<title>Hide your heart</title><quantity>1</quantity><price>9.90</price>

</item></shiporder>

Page 9: 8 soa technisch perspectief

9© Twynstra Gudde 19-5-2010

Service Oriented Architecture

XML and XSD (XML Schema Definition)

<shiporder orderid="889923"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation=""""shiporder.xsdshiporder.xsdshiporder.xsdshiporder.xsd"""">>>>

<orderperson>John Smith</orderperson><shipto>

<name>Ola Nordmann</name><address>Langgt 23</address><city>4000 Stavanger</city><country>Norway</country>

</shipto><item>

<title>Empire Burlesque</title><note>Special Edition</note><quantity>1</quantity><price>10.90</price>

</item><item>

<title>Hide your heart</title><quantity>1</quantity><price>9.90</price>

</item></shiporder>

<xs:element name="shipto"><xs:complexType><xs:sequence>

<xs:element name="name" type="xs:string"/><xs:element name="address" type="xs:string"/><xs:element name="city" type="xs:string"/><xs:element name="country" type="xs:string"/>

</xs:sequence></xs:complexType>

</xs:element>

<xs:element name="item" maxOccurs="unbounded"><xs:complexType><xs:sequence>

<xs:element name="title" type="xs:string"/><xs:element name="note" type="xs:string" minOccurs="0"/><xs:element name="quantity" type="xs:positiveInteger"/><xs:element name="price" type="xs:decimal"/>

</xs:sequence></xs:complexType>

</xs:element> XML

Part of the XSD

Part of the XSD

Page 10: 8 soa technisch perspectief

10© Twynstra Gudde 19-5-2010

Service Oriented Architecture

XML and XSD (XML Schema Definition)Example

<?xml version="1.0" encoding="ISO-8859-1"?>

<shiporder orderid="889923"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:noNamespaceSchemaLocation="shiporder.xsd"><orderperson>John Smith</orderperson><shipto><name>Ola Nordmann</name><address>Langgt 23</address><city>4000 Stavanger</city><country>Norway</country>

</shipto><item><title>Empire Burlesque</title><note>Special Edition</note><quantity>1</quantity><price>10.90</price>

</item><item><title>Hide your heart</title><quantity>1</quantity><price>9.90</price>

</item></shiporder>

<?xml version="1.0" encoding="ISO-8859-1" ?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="shiporder"><xs:complexType><xs:sequence><xs:element name="orderperson" type="xs:string"/><xs:element name="shipto"><xs:complexType><xs:sequence><xs:element name="name" type="xs:string"/><xs:element name="address" type="xs:string"/><xs:element name="city" type="xs:string"/><xs:element name="country" type="xs:string"/>

</xs:sequence></xs:complexType>

</xs:element><xs:element name="item" maxOccurs="unbounded"><xs:complexType><xs:sequence><xs:element name="title" type="xs:string"/><xs:element name="note" type="xs:string" minOccurs="0"/><xs:element name="quantity" type="xs:positiveInteger"/><xs:element name="price" type="xs:decimal"/>

</xs:sequence></xs:complexType>

</xs:element></xs:sequence><xs:attribute name="orderid" type="xs:string" use="required"/>

</xs:complexType></xs:element>

</xs:schema>

Complete XML

Complete XSD

XSD Defines thestructure of every XML

based on it

Page 11: 8 soa technisch perspectief

11© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Fundamental standards for web services (2)WSDL

Serviceimplementation

Serviceinterface

Visible service interface description

Invisible, encapsulatedinternal implementation

request

respons

XML

XML

HTTP

WSDL

Page 12: 8 soa technisch perspectief

12© Twynstra Gudde 19-5-2010

Service Oriented Architecture

WSDLWeb Service Definition Language

– Web Service Definition Language

– Define the service interface for a web service

– Contains all the information needed to call the web service

– Signature (name and paramaters): description of the request and response messages

– Protocal an location: where to find the service, and how to access it

<definitions>

<types>definition of types........

</types>

<message>definition of a message....

</message>

<portType>definition of a port.......

</portType>

<binding>definition of a binding....

</binding>

</definitions>

XSD definitionsused

Possiblerequest and

responsemessages

Interfacesrequest/response

combinations

How tocall it

Page 13: 8 soa technisch perspectief

13© Twynstra Gudde 19-5-2010

Service Oriented Architecture

WSDL exampleA simple Glossary

<message name="getTermRequest"><part name="term" type="xs:string"/>

</message>

<message name="getTermResponse"><part name="value" type="xs:string"/>

</message>

<portType name="glossaryTerms"><operation name="getTerm"><input message="getTermRequest"/><output message="getTermResponse"/>

</operation></portType>

<binding type="glossaryTerms" name="b1"><soap:binding style="document"transport="http://schemas.xmlsoap.org/soap/http" /><operation><soap:operation soapAction="http://example.com/getTerm"/><input><soap:body use="literal"/></input><output><soap:body use="literal"/></output>

</operation></binding>

SOAP actionthat corresponds

to this action

Request message

Response message

InterfaceWhen you send a“getTermRequest”

you get a“getTermResponse” back

Page 14: 8 soa technisch perspectief

14© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Fundamental standards for web services (3)SOAP

Serviceimplementation

Serviceinterface

Visible service interface description

Invisible, encapsulatedinternal implementation

request

respons

XML

XML

HTTP

WSDL

SOAP

Page 15: 8 soa technisch perspectief

15© Twynstra Gudde 19-5-2010

Service Oriented Architecture

SOAPSimple Object Access Protocol

– Simple Object Access Protocol– Call a component’s service by sending

an XML-message

– Based on standard internet technology (HTTP)

– Suitable for Business-to-Business communication: communication between dissimilar systems (often outside your own company)

– Requests and Responses can be sent and received as SOAP messages

<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Header>...</soap:Header>

<soap:Body>...<soap:Fault>...</soap:Fault>

</soap:Body>

</soap:Envelope>

Page 16: 8 soa technisch perspectief

16© Twynstra Gudde 19-5-2010

Service Oriented Architecture

A SOAP messagevan

aan

/ /Beste

Header

Body

Envelope

Page 17: 8 soa technisch perspectief

17© Twynstra Gudde 19-5-2010

Service Oriented Architecture

SOAPExample

<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body><m:GetPrice xmlns:m="http://www.w3schools.com/prices"><m:Item>Apples</m:Item>

</m:GetPrice></soap:Body>

</soap:Envelope> <?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body><m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices"><m:Price>1.90</m:Price>

</m:GetPriceResponse></soap:Body>

</soap:Envelope>

Request

Response

Page 18: 8 soa technisch perspectief

18© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Fundamental standards for web services (4)UDDI

Serviceimplementation

Serviceinterface

Visible service interface description

Invisible, encapsulatedinternal implementation

request

respons

XML

XML

HTTP

WSDL

SOAP

WebServices

Rotterdam

WebServices

Rotterdam

UDDI

Page 19: 8 soa technisch perspectief

19© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Web services

van

aan

van

aan

/ // /BesteBeste

XMLXMLXMLXML message

Inside aSOAPSOAPSOAPSOAP message

Sent overinternet (HTTPHTTPHTTPHTTP)

Described bya WSDLWSDLWSDLWSDLdefinition

Page 20: 8 soa technisch perspectief

20© Twynstra Gudde 19-5-2010

Service Oriented Architecture

Web services protocols

IP

TCP

HTTP

XML

SOAP

Transportprotocol

Applicationprotocol

WSDL

UDDISupportingprotocol

Page 21: 8 soa technisch perspectief

21© Twynstra Gudde 19-5-2010

Service Oriented Architecture

All rights reserved. No part of this presentation may be reproduced or published in any form or by any means without the prior written permission of Twynstra Gudde.

Bas [email protected]

www.twynstragudde.nl