8668c3d7ca5c86def859cbfcd70cd632.ppt
- Количество слайдов: 20
Chapter 2: Basic Standards for Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005
Highlights of this Chapter n n n Chapter 2 e. Xtensible Markup Language (XML) Simple Object Access Protocol (SOAP) Web Services Description Language (WSDL) Directory Services Universal Description, Discovery, and Integration (UDDI) Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 2
Standards for Web Services Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 3
Markup and Metadata History n n n None, e. g. , CSV Ad hoc tags SGML (Standard Generalized Markup L): complex, few reliable tools HTML (Hyper. Text ML): simple, unprincipled, mixes structure and display XML (e. Xtensible ML): simple, yet extensible subset of SGML to capture new vocabularies n n Chapter 2 Machine processible Generally, comprehensible (easier debugging), though verbose and arcane Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 4
XML Basics and Namespaces <? xml version="1. 0"? > <!– not part of the document per se --> <arbitrary: toptag xmlns="http: //one. default. namespace/if-needed" xmlns: arbitrary="http: //wherever. it. might. be/arbit-ns" xmlns: random="http: //another. one/random-ns"> <arbitrary: atag attr 1="v 1" attr 2="v 2"> Optional text also known as PCDATA <arbitrary: btag attr 1="v 1" attr 2="v 2" /> </arbitrary: atag> <random: simple_tag/> <!– abbreviate start and end --> <random: atag attr 3="v 3"/> <!– compare arbitrary: atag --> </arbitrary: toptag> Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 5
XML Schema n Grammar (data definition language) for specifying valid documents n n Uses same syntax as regular XML documents: verbose and difficult to read Provides local scoping of subelement names Incorporates namespaces Types n n n Chapter 2 Primitive (built-in): string, integer, float, date, … simple. Type constructors: list, union Restrictions: intervals, lengths, enumerations, regex patterns, Flexible ordering of elements Key and referential integrity constraints Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 6
Web Services: Basic Architecture Service Broker Publish or announce (WSDL) Service Provider Not well-known Chapter 2 Registry; well-known Find or discover (UDDI) Bind or invoke (SOAP) Service Requestor Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 7
Basic Profile (BP 1. 0) n The Web Services Interoperability Organization (WS-I) has specified the following Basic Profile version 1. 0: n n n Chapter 2 SOAP 1. 1 HTTP 1. 1 XML 1. 0 XML Schema Parts 1 and 2 UDDI Version 2 WSDL 1. 1 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 8
Describing a Service n n n Name e. g. , Get. Temperature Types of Input Parameters e. g. , (String, String) Types of Output Parameters e. g. , Integer Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 9
SOAP (Simple Object Access Protocol) n n n Used to exchange messages via HTTP, SMTP, and SIP (Session Initiation Protocol for Internet telephony) Originally designed for remote-procedure calls (RPC) Works through firewalls on port 80 Character-based, so easy to encrypt/decrypt and thus easy to secure Inefficient due to character, not binary, data and large headers Does not describe bidirectional or n-party interaction Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 10
Ex. SOAP Request POST /temp HTTP/1. 1 Host: www. socweather. com Content-Type: text/xml; charset="utf-8" Content-Length: xxx SOAPAction: "http: //www. socweather. com/temp" <!-- Above: HTTP headers and a blank line. --> <!—These comments and below: an XML document --> <? xml version=“ 1. 0”? > <env: Envelope xmlns: env="http: //schemas. xmlsoap. org/soap/envelope/" env: encoding. Style="http: //schemas. xmlsoap. org/soap/encoding/"/> <env: Body> <m: Get. Temp xmlns: m="http: //www. socweather. com/temp. xsd"> <m: City>Honolulu</m: City> <m: When>now</m: When> </m: Get. Temp> </env: Body> </env: Envelope> Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 11
Ex. SOAP Response HTTP/1. 1 200 OK Content-Type: text/xml; charset="utf-8" Content-Length: xxx SOAPAction: "http: //www. socweather. com/temp" <? xml version="1. 0"? > <env: Envelope xmlns: env="http: //schemas. xmlsoap. org/soap/envelope/" env: encoding. Style="http: //schemas. xmlsoap. org/soap/encoding/"/> <env: Body> <m: Get. Temp. Response xmlns: m="http: //www. socweather. com/temp. xsd"> <m: Degrees. Celsius>30</m: Degrees. Celsius> </m: Get. Temp. Response> </env: Body> </env: Envelope> Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 12
WSDL: Web Services Description Language n Describes a programmatic interface to a Web service, including n n n Chapter 2 Definitions of data types Input and output message formats The operations provided by the service Network addresses Protocol bindings Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 13
WSDL Data Model Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 14
Directory Services n Support discovery: enable applications, agents, Web service providers, Web service requestors, people, objects, and procedures to locate each other n n White pages – entries found by name Yellow pages – entries found by characteristics and capabilities A basic directory might be a simple database (passive) or a broker/facilitator (active, that provides alerts and recruits participants) UDDI – both white pages and yellow pages, but passive Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 15
UDDI: Universal Description, Discovery, and Integration UDDI is a Web service that is based on SOAP and XML UDDI registers n n Chapter 2 t. Models: technical descriptions of a service’s behavior business. Entities: describes the specifications of multiple t. Models Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 16
Yellow, Green, and White Pages in UDDI Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 17
Data Model for UDDI Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 18
WSDL UDDI Chapter 2 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 19
Chapter 2 Summary The main triad of Web services standards n Bring together well-known ideas n n n n Chapter 2 SOAP: object access and messaging WSDL: based on CORBA IDL UDDI: based on directories Provide necessary functionality for interoperation Are complicated in their details Meant for tool vendors rather than programmers Increasingly hidden by tools Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 20
8668c3d7ca5c86def859cbfcd70cd632.ppt