Download presentation
Presentation is loading. Please wait.
1
Web Services – Introduction Jens Greive Ayman Tarakji
2
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 2 Outline Web Service introduction Service Oriented Architecture Practical examples Basic of Extensible Markup Language (XML) DTD Schema UDDI – Publishing Web Services WSDL – A formal language to describe Web Services SOAP – Accessing Web Services Example from www.xmethods.com Some challenges of the Web Service Technologie
3
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 3 Web Services – A Description „ Web service is a piece of software, which provide functionality as blackbox, available on server, accessible via a simple object access protocol and has a well-defined interface“ An example is Google without browser.
4
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 4 Why Web Services? Transactional web is desired Convert applications into web applications Interaction between different systems is needed Web services can perform functions which can be anything from a simple request to a complicated business process (weather reports, Amazon, etc) Web services are self-contained and self-describing Using a service-oriented architecture to provide business services accessed by other applications
5
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 5 SOA – Service Oriented Architecture (1) Provider – Implements and publishes a web service (WSDL) – Provides the service to customers (SOAP) Broker – Holds a list of published web services (UDDI) – Provides a dynamic search functionality for requesters (UDDI) Requester – Searches for a specific web service in the broker's list (WSDL) – Establishes a connection with the provider and uses the service (SOAP)
6
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 6 Web Services (Examples) Book a flight South West Airline connects its own booking system with the one of Dollar Car Rentals using Dollar Car's Web Service A customer booking a flight over the South West homepage can book a car together with the flight without leaving the South West website Restaurant guide for PDAs Makes suggestions of restaurants for a user based on the user's profile Calls the Web Service of www.mapquest.com to provide directions to the restaurantswww.mapquest.com
7
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 7 Web Service - Requirements A mechanism to allow document transfer Possibility to make Remote Procedure Calls (RPCs) An easy protocol Platform independency Ability to be processed by common programming languages A formal, standardized language to allow communication between the different roles
8
Regionales Rechenzentrum für Niedersachsen XML – Extensible Markup Language Unlike HTML, XML is used to describe data and not to display it Currently the lingua franca of information and data encoding Cross-platform, soft- and hardware independent tool for exchanging information A meta language for creating xml-based mark-up languages (SGML) Classification of XML languages Data oriented languages (database systems) Document oriented languages (WML) Protocols and programming languages (XSD, XSLT, WSDL, etc.) Hybrids (data and document oriented)
9
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 9 XML namespaces Using URIs to identify different name spaces The cheapest way of getting unique names and avoiding confusions. description of gadget … <widget type=“gadget“ xmlns=“http://www.widget.inc“> <info xmlns:xhtml=“http://www.w3....“> description of gadget …
10
Regionales Rechenzentrum für Niedersachsen XML syntax Syntax: very simple and very strict (well-formed) each document has a root element, which in turn has child elements Oak Pine Maple Bluegrass Fescue Rye </LAND
11
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 11 XML syntax: DTD (Data Type Definition) A schema language for defining the grammar and restrictions over data for the XML document Basic declaration forms in example: <!DOCTYPE land SYSTEM=“http://.../land.dtd>... <!DOCTYPE land SYSTEM=”http://.../land.dtd... Valid Not Valid
12
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 12 XML syntax: DTD (Data Type Definition) Pros A simple schema language with a restricted expressive power Cons character data limitation limited reusability no namespaces supported not self describable not scalable
13
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 13 XML syntax: XSD (XML Schema Definition) One of the key komponents of XML Overcome DTD limitations (more expressive, self describing and namespaces supporting) Inspired from object-oriented programming languages (reuse&comprehensibility) Global as well as local declarations Modularization Nil values in Elements annotations(human readable documentation) subsumption and substitution(xsi:type attribute) The most central constructs in XSD: 1.Simple type definition 2.Complex type definition 3.Element declaration 4.Attribute declaration
14
Regionales Rechenzentrum für Niedersachsen XSD - Example <schema xmlns=“http://www.w3.org/2001/XMLSchema” xmlns:b=“http://businesscard.org targetNamespace=“http://businesscard.org”>
15
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 15 XML Schema (1) Pros More expressive than DTD Self described Namespace support Written in XML Reusable & comprehensibility More flexible Cons Too complicated and hard to use (Type mechanism) Context insensitivity – typical problem in XML languages Difficult to enforce a particular root element
16
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 16 XML Schema (2) Common approach to overcome these problems(guidelines) Example:guildlines of „Danish ministry of science“ Always employ namespaces Use global definitions Reuse existing definitions whenever possible Don´t use the list construct Avoid substitution groups Don´t use unqualified local elements and many more.
17
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 17 UDDI – Universal Description Discovery and Integration
18
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 18 UDDI – Universal Description Discovery and Integration UDDI is an XML-based, platform-independent registry allows businesses worldwide to publish their services and find usefull services provided by other companies A UDDI can be thought of as a DNS for business applications has a SOAP interface Two main goals for service discovery Support developers in finding information about services, so they know how to write clients which can interact with those services Enable dynamic binding by allowing clients to query the registry and obtain references to services of interest An UDDI business registration consists of three components White Pages – Basic information like name, address, unique identifier Yellow Pages – Categorizes the registered businesses Green Pages – Technical information describing the provided services and how they can be invoked
19
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 19 UDDI – Data types
20
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 20 WSDL
21
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 21 WSDL WSDL is a platform-, protocol and programming language independent XML- Specification to describe Web Services Is a Meta language Describes the provided functions, data and types A WSDL document contains information about the provided interface the protocol which must be used how the service can be accessed The document does not contain information about Quality-of-Service-Information Taxonomy/Ontology for semantic description of the service
22
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 22 WSDL – Description elements Datatypes Definition of the datatypes, which are used to exchange the message Message An abstract definition of the transported data Port types Define the operations so that the Web Service knows how to interpret the data and what kind of data has to be returned 4 different types of exchanged messages One-way: The service receives an input message from the client Request-Response: The service receives an input message from the client and sends an answer Solicit-response: The service sends a message to the client and waits for a response Notification: The service sends an output message Binding Defines the concrete protocol for every port type Ports Defines an address for the binding. Usually an URI Service Identifies a Web Service
23
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 23 WSDL – An example (1) Book price at Barnes & Nobles by ISBN <s:schema elementFormDefault="qualified" targetNamespace="http://www.abundanttech.com/webservices/BNPrice"> <s:element minOccurs="0" maxOccurs="1" name="sISBN" type="s:string"/> <s:element minOccurs="0" maxOccurs="1" name="GetBNQuoteResult" type="s:string"/>
24
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 24 WSDL – An Example (2)
25
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 25 WSDL – An Example (3) <wsdl:port name="BNPriceWSSoap" binding="tns:BNPriceWSSoap"> <wsdl:port name="BNPriceWSHttpGet" binding="tns:BNPriceWSHttpGet"> <wsdl:port name="BNPriceWSHttpPost" binding="tns:BNPriceWSHttpPost">
26
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 26 WSDL Pros Independency between client and server Programming language independent Plenty of tools available for processing WSDL documents (code generators like wsdl2java) Cons Overhead because of XML
27
Regionales Rechenzentrum für Niedersachsen SOAP
28
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 28 SOAP – Simple Object Access Protocol (1) Is not simple Since version 1.2 the abbreviation is no longer used as an acronym because SOAP is not simple and has nothing to do with accessing objects Is a framework Sets no rules about the data which should be sent Any application specific data can be transported SOAP provides a ruleset to define how the XML-Document must look like Based on existing technologies XML to describe the data Internet protocols to transport the data Common combination is SOAP over HTTP and TCP Network protocol which allows transfer of documents between systems to call procedures on remote systems (Remote Procedure Calls, RPCs)
29
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 29 SOAP – Simple Object Access Protocol (2) A SOAP message consists of An SOAP-Envelope, the root element An optional SOAP-Header with processing instructions The SOAP-Body containing the data SOAP in the TCP/IP Protocol stack
30
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 30 XML to SOAP <SOAP-ENV:Envelope xmlns:SOAP-ENV=‘http://schemas.xmlsoap.org/soap/envelope/’http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi=‚http://www.w3.org/1999/XMLSchema-instance‘ xmlns:xsd=‚http://www.w3.org/1999/XMLSchema‘> … Joe Smith 14 Oak Park … … Eigentliches XML-Dokument
31
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 31 SOAP – Remote Procedure Call Call of a service which returns the price of a book at Barnes & Nobles by a given ISBN: <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 0130449687 49.99 Response: http://www.abundanttech.com/webservices/bnprice/bnprice.asmx
32
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 32 SOAP Pros Allows the use of different transport protocols (HTTP, FTP, etc.) HTTP makes communication behind proxies and firewalls easier XML is simple to parse and widely spread Easy interaction with a lot of programming languages Cons Using XML in SOAP leads to more overhead and slower traffic Many SOAP implementations limit the amount of exchanged data
33
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 33 Using a Web Service – Step 1 www.xmethods.com
34
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 34 Using a Web Service – Step 2
35
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 35 Challenges Integrating the semantic web specification into Web Services (semantic web annotations group) Getting Web Services to the point that they can be found and used by applications without human interaction Based on XML WSDL and SOAP are machine readable and processable More security in Web Services Delivering a suitable Web Service for the user‘s need (ranking problem)
36
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 36 Summary Web Services SOA XML UDDI WSDL SOAP Examples Challenges
37
Regionales Rechenzentrum für Niedersachsen Web Services Introduction | 13.06.2007 | Folie 37 Sources XML An introduction to xml and web technologies; Anders Miller, Michael I. Schwartzbach; Addison Wesley; (Link)Link http://www.comptechdoc.org/independent/web/xml/guide/ http://webservices.xml.com/index.csp http://www.developer.com/ http://www.ibm.com/us/ http://www.w3schools.com Web Services Java Web Services; David A. Chappell, Tyler Jewell; O‘Reilly; (Link)Link http://www.w3.org/2002/ws/ http://www.xmethods.com Some more intresting links http://www.soapclient.com/uddisearch.html http://www.amazon.com/gp/browse.html?node=3435361 http://code.google.com/
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.