ICT Architectures 11 SOA from a technical perspective


























- Slides: 26
ICT Architectures 11 – SOA from a technical perspective Bas Kruiswijk | Leiden April 9, 2019 1
Contents 1. Service from a technical perspective 2. Web services • HTTP • XML and XSD • WSDL • SOAP • UDDI 3. International standards • Web service stack / family of standards • Alternatives: REST, JSON 4. Demo 2
Roadmap Architecture Alignment Strategy • Strategic alignment • Information management • Enterprise architecture • Software architecture • Service oriented architecture • Business strategy • ICT Strategy 3
Three ‘types’ of ICT architectures Enterprise architecture Software architecture Service oriented architecture Conceptual foundations Enterprise scope Individual ICT system scope Focus on strategy and communication Focus on specification, design and realisation 4
Services • From a technical perspective a logical next step following object- en component technology - Broad adoption of (internet)standards for web services - Platform independant - Central concept in (almost) alle current software development platforms (for instance the Java and . NET based platforms) 5
Service Visible service interface description request Service interface response Service implementation Invisible, encapsulated internal implementation 6
Web services • Web services are the most common technical implementation of services - Web services are not the only possible technical implementation - The term web services refers to a collection of standards that cover interoperability • Fundamental standards - XML (e. Xtensible Markup Language) and XSD (XML Schema Definition) - HTTP (Hyper. Text Transfer Protocol) - WSDL (Web Service Description Language) - SOAP (Simple Object Access Protocol) - UDDI (Universal Description, Discovery and Integration) 7
Fundamental standards for web services (1) HTTP and XML(existed before web services) Visible service interface description XML request Service interface Service implementation XML HTTP response Invisible, encapsulated internal implementation 8
XML Example • e. Xtensible Markup Language for data -exchange, -storage and –presentation • General format, tag-structure • Most other web services standards (and many others) are based on XML <books> <book> <author>Don Box</author> <title>Essential XML</title> <price>34, 95</price> </book> <author>Linus Torvalds</author> <title>Linux for Fun</title> <price>34, 95</price> </books> <Client. Suwi> <Sofi. Nr>123456789</Sofi. Nr> <Bank. Gironr>01982712</Bank. Gironr> <Telefoonnr. Client> <Telefoonnr> <Netnr>020</Netnr> <Abonneenr>4890000</Abonneenr> </Telefoonnr. Client> </Client. Suwi> 9
XML and XSD (XML Schema Definition) Example <shiporderid="889923" xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" xsi: no. Namespace. Schema. Location="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> • An XML File has a structure • An XML Schema Definition (XSD) describes this structure 10
XML and XSD (XML Schema Definition) <shiporderid="889923" xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" Part of the XSD xsi: no. Namespace. Schema. Location="shiporder. xsd" > <xs: element name="shipto"> <orderperson>John Smith</orderperson> <xs: complex. Type> <shipto> <xs: sequence> <name>Ola Nordmann</name> <xs: element name="name" type="xs: string"/> <address>Langgt 23</address> <xs: element name="address" type="xs: string"/> <city>4000 Stavanger</city> <xs: element name="city" type="xs: string"/> <country>Norway</country> <xs: element name="country" type="xs: string"/> </shipto> </xs: sequence> <item> </xs: complex. Type> <title>Empire Burlesque</title> </xs: element> <note>Special Edition</note> <quantity>1</quantity> <price>10. 90</price> <xs: element name="item" max. Occurs="unbounded"> </item> <xs: complex. Type> <item> <xs: sequence> <title>Hide your heart</title> <xs: element name="title" type="xs: string"/> <quantity>1</quantity> <xs: element name="note" type="xs: string" min. Occurs="0"/> <price>9. 90</price> <xs: element name="quantity" type="xs: positive. Integer"/> </item> <xs: element name="price" type="xs: decimal"/> </shiporder> </xs: sequence> XML </xs: complex. Type> </xs: element> Part of the XSD 11
XML and XSD (XML Schema Definition) Example <? xml version="1. 0" encoding="ISO-8859 -1" ? > <xs: schema xmlns: xs="http: //www. w 3. org/2001/XMLSchema"> <? xml version="1. 0" encoding="ISO-8859 -1"? > <shiporderid="889923" xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" xsi: no. Namespace. Schema. Location="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> Complete XML XSD Defines the structure of every XML based on it <xs: element name="shiporder"> <xs: complex. Type> <xs: sequence> <xs: element name="orderperson" type="xs: string"/> <xs: element name="shipto"> <xs: complex. Type> <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: complex. Type> </xs: element> <xs: element name="item" max. Occurs="unbounded"> <xs: complex. Type> <xs: sequence> <xs: element name="title" type="xs: string"/> <xs: element name="note" type="xs: string" min. Occurs="0"/> <xs: element name="quantity" type="xs: positive. Integer"/> <xs: element name="price" type="xs: decimal"/> </xs: sequence> </xs: complex. Type> </xs: element> </xs: sequence> <xs: attribute name="orderid" type="xs: string" use="required"/> </xs: complex. Type> </xs: element> </xs: schema> Complete XSD 12
Fundamental standards for web services (2) WSDL Visible service interface description XML WSDL request Service interface Service implementation XML HTTP respons Invisible, encapsulated internal implementation 13
WSDL Web Service Description 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 and location: where to find the service, and how to access it <definitions> <types> definition of types. . . . </types> <message> definition of a message. . </message> <port. Type> definition of a port. . . . </port. Type> <binding> definition of a binding. . </binding> XSD definitions used Possible request and response messages Interfaces request/ response combinations How to call it </definitions> 14
WSDL example: a simple Glossary Request message <message name="get. Term. Request"> <part name="term" type="xs: string"/> </message> Response message <message name="get. Term. Response"> <part name="value" type="xs: string"/> </message> Interface When you send a “get. Term. Request” you get a “get. Term. Response” back SOAP action that corresponds to this action <port. Type name="glossary. Terms"> <operation name="get. Term"> <input message="get. Term. Request"/> <output message="get. Term. Response"/> </operation> </port. Type> <binding type="glossary. Terms" name="b 1"> <soap: binding style="document" transport="http: //schemas. xmlsoap. org/soap/http" /> <operation> <soap: operation soap. Action="http: //example. com/get. Term"/> <input><soap: body use="literal"/></input> <output><soap: body use="literal"/></output> </operation> </binding> 15
Fundamental standards for web services (3) SOAP Visible service interface description XML WSDL request Service interface Service implementation SOAP XML HTTP respons Invisible, encapsulated internal implementation 16
SOAP Simple 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: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soa p-envelope" soap: encoding. Style="http: //www. w 3. org/200 1/12/soap-encoding"> <soap: Header>. . . </soap: Header> <soap: Body>. . . <soap: Fault> . . . </soap: Fault> </soap: Body> </soap: Envelope> 17
A SOAP message Header van aan Beste / / Body Envelope 18
SOAP Example Request <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Body> <m: Get. Price xmlns: m="http: //www. w 3 schools. com/prices"> <m: Item>Apples</m: Item> </m: Get. Price> </soap: Body> </soap: Envelope> Response <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Body> <m: Get. Price. Response xmlns: m="http: //www. w 3 schools. com/prices"> <m: Price>1. 90</m: Price> </m: Get. Price. Response> </soap: Body> </soap: Envelope> 19
Fundamental standards for web services (4) UDDI Visible service interface description XML WSDL request Service interface Service implementation SOAP XML HTTP Invisible, encapsulated internal implementation respons UDDI 20
Web services XML message Inside a SOAP message Described by a WSDL definition Sent over internet (HTTP) 21
Web services protocol stack UDDI WSDL Supporting protocol SOAP XML Application protocol HTTP TCP IP Transport protocol 22
All web service related standards See figure 16 -3 on page 220 23
Alternatives to SOAP • REST - Representational State Transfer - Simple and stateless access to resources - By using standard HTTP, without the use of WSDL and SOAP - Using the standard HTTP-operations (POST, GET, PUT, DELETE) for create, read, change and delete operations - (See page 228) 24
Web services demo • Standard web services testing tool: Soap. UI (https: //www. soapui. org/) • Examples: https: //www. dataaccess. com/products/dataflex/features/web-services/webservices-examples-1105 25
ICT Architectures 11 – SOA from a technical perspective 26