Chapter 2: Basic Standards for Web Services Service-Oriented Computing: Semantics, Processes, Agents...
-
date post
21-Dec-2015 -
Category
Documents
-
view
217 -
download
1
Transcript of Chapter 2: Basic Standards for Web Services Service-Oriented Computing: Semantics, Processes, Agents...
Chapter 2:Basic Standards for Web Services
Service-Oriented Computing: Semantics, Processes, Agents– Munindar P. Singh and Michael N. Huhns, Wiley, 2005
Chapter 2 2Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Highlights of this Chapter
eXtensible Markup Language (XML) Simple Object Access Protocol
(SOAP) Web Services Description
Language (WSDL) Directory Services Universal Description, Discovery,
and Integration (UDDI)
Chapter 2 3Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Standards for Web Services
BPEL4WSOWL-S Service
Model
ebXMLCPA
Process and workfloworchestrations
QoS: Servicedescriptions and bindings
Contracts andagreements
XLANG
WSCL
WSDLebXML
CPP
ebXMLBPSS
XML, DTD, and XML Schema
HTTP, FTP, SMTP, SIP, etc.
SOAPebXML
messaging
OWL
UDDIebXML
Registries
WSCLWSCI
WS-Coordination
WS-AtomicTransaction and WS-BusinessActivity
OWL-S ServiceGrounding
OWL-S ServiceProfile
BTP
BPML
Discovery
Messaging
Transport
QoS: Conversations
QoS: Choreography
QoS: Transactions
Encoding
WS-Policy
WS-Security
WS-ReliableMessaging
PSL
RDF
Chapter 2 4Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
XML Web Service Foundation
Open and with broad industry support
Publish, Find, Use Services UDDI
Service Interactions SOAP
Universal Data Format XML
Description Language WSDL
Ubiquitous Communications TCP/IP, HTTP, SMTP, SIP, Reliable messaging
Security (authentication and authorization) WS-Security, SAML
Chapter 2 5Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Markup History
None, as in comma separated values Ad hoc tags SGML (Standard Generalized Markup L):
complex, few reliable tools HTML (HyperText ML): simple,
unprincipled, mixes structure and display XML (eXtensible ML): simple, yet
extensible subset of SGML to capture new vocabularies Machine processible Comprehensible to people: easier debugging
Chapter 2 6Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
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 attr1=“v1” attr2=“v2”>Optional text also known as PCDATA
<arbitrary:btag attr1=“v1” attr2=“v2” /></arbitrary:atag><random:simple_tag/><random:atag attr3=“v3”/> <!– compare with
arbitrary:atag above </arbitrary:toptag>
Chapter 2 7Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
XML Schema A data definition language for XML: defines
a notion of schema validity; helps us define desired grammars for documents Same syntax as regular XML documents Local scoping of subelement names Incorporates namespaces Types
Primitive (built-in): string, ID, IDREF, integer, float, date,
simpleType constructors: list, union Restrictions: intervals, lengths, enumerations, regex
patterns, Flexible ordering of elements
Key and referential integrity constraints
Chapter 2 8Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Web Services: Basic Architecture
ServiceBroker
ServiceProvider
ServiceRequesto
r
Bind or invoke(SOAP)
Find or discover(UDDI)
Publish or announce(WSDL)
Registry; well-known
Not well-known
Chapter 2 9Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Basic Profile (BP 1.0)
The Web Services Interoperability Organization (WS-I) has specified the following Basic Profile version 1.0: SOAP 1.1 HTTP 1.1 XML 1.0 XML Schema Parts 1 and 2 UDDI Version 2 WSDL 1.1
Chapter 2 10Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Describing a Service
Namee.g., GetTemperature
Types of Input Parameterse.g., (String, String)
Types of Output Parameterse.g., Integer
Chapter 2 11Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Interactions
Via MethodsVia Methods Via MessagesVia Messages
Purchasing()Purchasing()
CatalogService()CatalogService()
Order()Order()
invokeinvoke
invokeinvoke
catalogcatalog
confirmation #confirmation #
Dell Purchasing Intel Sales
SubmitPO
AckPO
SubmitASN
SubmitInvoice
SubmitPayment
Chapter 2 12Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
SOAP (Simple Object Access Protocol)
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 13Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Ex. SOAP Request
POST /temp HTTP/1.1Host: www.socweather.comContent-Type: text/xml; charset="utf-8"Content-Length: xxxSOAPAction: "http://www.socweather.com/temp"
<!-- The above are HTTP headers --><?xml version=“1.0”?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <env:Body> <m:GetTemp xmlns:m="http://www.socweather.com/temp.xsd"> <m:City>Honolulu</m:City> <m:When>now</m:When> </m:GetTemp> </env:Body></env:Envelope>
Chapter 2 14Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Ex. SOAP Response
HTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8"Content-Length: xxxSOAPAction: "http://www.socweather.com/temp"
<?xml version=“1.0”?><env:Envelope
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<env:Body> <m:GetTempResponse
xmlns:m="http://www.socweather.com/temp.xsd"> <DegreesCelsius>30</DegreesCelsius> </m:GetTempResponse> </env:Body></env:Envelope>
Chapter 2 15Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL: Web Services Description Language
Describes a programmatic interface to a Web service, including Definitions of data types Input and output message formats The operations provided by the service Network addresses Protocol bindings
Chapter 2 16Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Data Model definitions targetNamespace=thisNamespace xmins:tns=thisNamespace
types message name=in message name=out
portType name=foo operation input message=tns:in output message=tns:out
binding name=foobar type=tns:foo [binding information]
service name=foobar Service
Port name=foobarPort binding=tns:foobar [endpoint information]
Types contains data type definitionsMessages consist of one or more parts
A portType describes an abstract setof operations
A binding describes a concrete set offormats and protocols for the fooportTypes
A port describes an implementationof the foobar binding
Chapter 2 17Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Example: 1
<?xml version="1.0"?><!-- the root element, wsdl:definitions, defines a set of --><!-- related services --><wsdl:definitions name="Temperature" targetNamespace="http://www.socweather.com/schema" xmlns:ts="http://www.socweather.com/TempSvc.wsdl"
xmlns:tsxsd="http://schemas.socweather.com/TempSvc.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
Chapter 2 18Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Example: 2
<!-- wsdl:types encapsulates schema definitions of --><!-- communication types; here using xsd --> <wsdl:types><!-- all type declarations are expressed in xsd --> <xsd:schema targetNamespace="http://namespaces.socweather.com" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<!-- xsd def: GetTemp [City string, When string] --> <xsd:element name="GetTemp"> <xsd:complexType> <xsd:sequence> <xsd:element name="City" type="string"/> <xsd:element name="When" type="string"/> </xsd:sequence> </xsd:complexType> </xsd:element>
Chapter 2 19Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Example: 3<!-- xsd def: GetTempResponse [DegreesCelsius integer] --> <xsd:element name="GetTempResponse"> <xsd:complexType> <xsd:all> <xsd:element name="DegreesCelsius" type="integer"/> </xsd:all> </xsd:complexType> </xsd:element>
<!-- xsd def: GetTempFault [errorMessage string] --> <xsd:element name="GetTempFault"> <xsd:complexType> <xsd:all> <xsd:element name="errorMessage" type="string"/> </xsd:all> </xsd:complexType> </xsd:element> </xsd:schema> </wsdl:types>
Chapter 2 20Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Example: 4<!-- wsdl:message elements describe potential transactions --><!-- Most messages, as here, have only one part. Multiple --><!-- parts provide a way to aggregate complex messages -->
<!-- request GetTempRequest is of type GetTemp --> <wsdl:message name="GetTempRequest"> <wsdl:part name="body" element="tsxsd:GetTemp"/> </wsdl:message>
<!-- response GetTempResponse is of type GetTempResponse --> <wsdl:message name="GetTempResponse"> <wsdl:part name="body" element="tsxsd:GetTempResponse"/> </wsdl:message>
<!-- wsdl:portType describes messages in an operation --> <wsdl:portType name="GetTempPortType">
<!-- wsdl:operation describes the entire protocol from --><!-- input to output or fault --> <wsdl:operation name="GetTemp"><!-- The order of input and output is significant; input --><!-- preceding output indicates the request-response --><!-- operation type --> <wsdl:input message="ts:GetTempRequest"/> <wsdl:output message="ts:GetTempResponse"/> <wsdl:fault message="ts:GetTempFault"/> </wsdl:operation> </wsdl:portType>
Chapter 2 21Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Example: 5<!-- wsdl:binding states a serialization protocol for --><!-- this service --> <wsdl:binding name="TempSvcSoapBinding" type="ts:GetTempPortType">
<!-- leverage off soap:binding document style --> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<!-- semi-opaque container of network transport details --> <!-- classed by soap:binding above @@@ --> <wsdl:operation name="GetTemp"> <soap:operation soapAction="http://www.socweather.com/TempSvc"/><!-- further specify that the messages in the --><!-- wsdl:operation "GetTemp" use SOAP? @@@ --> <wsdl:input> <soap:body use="literal"
namespace="http://schemas.socweather.com/TempSvc.xsd"/> </wsdl:input> <wsdl:output> <soap:body use="literal"
namespace="http://schemas.socweather.com/TempSvc.xsd"/> </wsdl:output> <wsdl:fault> <soap:body use="literal"
namespace="http://schemas.socweather.com/TempSvc.xsd"/> </wsdl:fault> </wsdl:operation> </wsdl:binding>
Chapter 2 22Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL Example: 6
<!-- wsdl:service names a new service "TemperatureService" -->
<wsdl:service name="TemperatureService"> <wsdl:documentation>socweather.com temperature service </wsdl:documentation>
<!-- connect it to the binding "TempSvcSoapBinding" above --> <wsdl:port name="GetTempPort"
binding="ts:TempSvcSoapBinding">
<!-- give the binding a network address --> <soap:address
location="http://www.socweather.com/TempSvc"/> </wsdl:port> </wsdl:service></wsdl:definitions>
Chapter 2 23Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Directory Services Support discovery: enable applications,
agents, Web service providers, Web service requestors, people, objects, and procedures to locate each other 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 24Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
UDDI: Universal Description, Discovery, and Integration
UDDI is a Web service that is based on SOAP and XML
UDDI registers1. tModels: technical descriptions of a
service’s behavior2. businessEntities: describes the
specifications of multiple tModels
Chapter 2 25Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Yellow, Green, and White Pages in UDDI
-businessKey : string(idl)-name : string(idl)-description : string(idl)-URL : string(idl)-contacts : contact-businessServices : businessService-identifierBag : keyedReference-categoryBag : keyedReference
businessEntity
1
*
-tModelKey : string(idl)-keyName : string(idl)-keyValue : string(idl)
keyedReference
-serviceKey : string(idl)-tModelKey : string(idl)-name : string(idl)-description : string(idl)-bindingTemplates
businessService
-phone : string(idl)-address : string(idl)
contact
Chapter 2 26Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
UML Model for Business Entity in a UDDI Registry
-businessKey-name-description-businessServices-categoryBag-identifierBag
businessEntity
-serviceKey-businessKey-name-description-bindingTemplates-categoryBag
businessService
-bindingKey-serviceKey-description-accessPoint
bindingTemplate
-name-description-overviewDoc-categoryBag-identifierBag
tModel
identifierBag
categoryBag
-keyName-keyValue
keyedReference
-description-overviewDoc
tModelInstanceInfo
Chapter 2 27Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Core Data Structures for UDDI
businessEntity: Information about theparty who publishes information about
a service
businessService: Descriptiveinformation about a particular family of
technical services
bindingTemplate: Technicalinformation about a service entry point
and implementation specs
tModel: Descriptions of specificationsfor services or value sets. Basis for
technical fingerprints
businessEntities containbusinessServices
businessServices containbindingTemplates
bindingTemplates contain referencesto tModels. These references
designate the interface specificationsfor a service
Chapter 2 28Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
WSDL UDDI Correspondence
<import>
<port>
<port>
BusinessEntity
BusinessService
BindingTemplate
BindingTemplate
Service Implementation
UDDI
<service>
Service Interface
<types>
<message>
<portType>
<binding>
tModel
WSDL
Chapter 2 29Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
An Inquiry to a UDDI Registry
A UDDI registry acts as a service in its own right
<?xml version="1.0" encoding="UTF-8"?><find_business xmlns="urn:uddi-org:api_v3"> <findQualifiers> <findQualifier> uddi:uddi.org:findqualifier:exactmatch </findQualifier> </findQualifiers> <!--find information about all businesses with the exact name "WeatherService Inc." --> <name>WeatherService Inc.</name></find_business>
Chapter 2 30Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Response from a UDDI Registry
<?xml version="1.0" encoding="UTF-8"?><businessList> <businessInfos> <businessInfo businessKey="...KO..."> <name>WeatherService, Inc.</name> <serviceInfos> <serviceInfo serviceKey="...KN..." businessKey="...K1..."> <name>Temperature Service</name> </serviceInfo> </serviceInfos> </businessInfo> </businessInfos></businessList>
Chapter 2 31Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and
Michael Huhns
Chapter 2 Summary
The main triad of Web services standards Bring together well-known ideas Provide necessary functionality for
interoperation Are complicated in their details Meant for tool vendors rather than
programmers Increasingly hidden by tools