Title: BP1070: Web Services A Technical Overview
1BP1070Web Services A Technical Overview
- Ken Wilner (wilner_at_progress.com)
- Fellow
2Agenda
- Web Services Architecture
- Wire Stack
- Description Stack
- Discovery Stack
- Thats All Folks
3What Is a Web Service?
- A Web Service is a software system identified by
a URI, whose public interfaces and bindings are
defined and described by XML. - Its definition can be discovered by other
software systems. - These systems may then interact with the Web
Service in a manner prescribed by its definition,
using XML based messages conveyed by internet
protocols.
Web Services ArchitectureW3C Working Draft 14
November 2002http//www.w3.org/TR/ws-arch/
What the standards guys are saying.
4What is a Web Service?
- An application that can be accessed over the
Web or any network from another application using
RPC style calls encoded using SOAP over HTTP
where the interface is described using WSDL
Ken Wilner, Fellow PSC
Reality today.
5Service-Oriented Architecture and Web Services
Web ServiceRegistry
Publish, Find, and Bind
Find Web Service
Publish Web Service
ServiceDetails
Interact (Bind)
Web Service Provider
Web ServiceRequestor
6Web Services Protocol Stacks
Directory
UDDI
A
Inspection
Messaging
Discovery Stack
Data Encoding
Network Protocol
Service Orchestration
Wire Stack
Service Description
Datatype Definition
Description Stack
7Web Services Implementation Architecture
Web Server
ApplicationServer
POST(Soap)
Web Service Client
HTTP Listener
SOAP Processor
BusinessLogic
Business Interface
Response(Soap)
WSDL
Web Service
8OpenEdge Web Services Toolkit Architecture
9Why Should I Care?
- Understand the standards that make up Web
Services - Understand the state of Web Services and where
its heading - Understand how to use Web Services efficiently
- Understand why Web Services will be successful
and where
10Agenda
- Web Services Architecture
- Wire Stack
- Description Stack
- Discovery Stack
- Thats All Folks
Messaging
Data Encoding
Network Protocol
Wire Stack
11What It Is.
- A lightweight xml-based protocol for message
exchange - Supports message typing, strong typing, and
structured data - Can be used in a variety of communication
paradigms - Programming language and platform independent
- Highly extensible
- Transport independent
- Encoding independent
- Extra context via headers
12What It Is
- W3C Note SOAP V1.1 http//www.w3.org/TR/SOAP
- SOAP message format
- SOAP encoding
- SOAP over HTTP transport binding
- SOAP for RPC convention
- W3C Draft SOAP V1.2
- http//www.w3.org/TR/soap12-part0/
- http//www.w3.org/TR/soap12-part1/
- http//www.w3.org/TR/soap12-part2/
13SOAP Message
ltEnvelopegt encloses message
SOAP Envelope
14SOAP Message
lt?xml version"1.0" encoding"UTF-8"?gt ltSOAP-ENVE
nvelope SOAP-ENVencodingStyle "http//sch
emas.xmlsoap.org/soap/encoding/"
xmlnsSOAP-ENV "http//schemas.xmlsoap.org
/soap/envelope/" xmlnsxsd"http//www.w3.org/200
1/XMLSchema" xmlnsxsi"http//www.w3.org/2001/X
MLSchema-instance"gt ltSOAP-ENVHeadergt lthdSecu
rity xmlnshd"http//www.e1.com"gt ltusernamegtWi
lnerlt/usernamegt ltpasswordgtBigDeallt/passwordgt
lt/hdSecuritygt lt/SOAP-ENVHeadergt ltSOAP-ENVBody
gt ltns1GetCustomer xmlnsns1"http//www.e1.com"
gt ltCustomerId xsitype"xsdint"gt6734lt/Custo
merIdgt lt/ns1GetCustomergt lt/SOAP-ENVBodygt lt/SO
AP-ENVEnvelopegt
15SOAP Envelope
ltSOAP-ENVEnvelope SOAP-ENVencodingStyle "
http//schemas.xmlsoap.org/soap/encoding/"
xmlnsSOAP-ENV "http//schemas.xmlsoap.org/
soap/envelope/" xmlnsxsd"http//www.w3.org/2001
/XMLSchema" xmlnsxsi"http//www.w3.org/2001/XM
LSchema-instance"gt ltSOAP-ENVBodygt lt/SOAP-
ENVBodygt lt/SOAP-ENVEnvelopegt
16SOAP Body
- Body entry contains application-specific data
- Serialized based on encodingStyle
- May represent an RPC request or response message,
a specific document, or whatever you want
17SOAP Body
ltSOAP-ENVEnvelope gt ltSOAP-ENVBodygt ltns1Ge
tCustomer xmlnsns1"http//www.e1.com"gt
ltCustomerId xsitype"xsdint"gt6734lt/CustomerIdgt
lt/ns1GetCustomergt lt/SOAP-ENVBodygt lt/SOAP-EN
VEnvelopegt
18SOAP Header
- Allows (optional) context information to be added
to message independently of the payload - Authentication and authorization information
- Transaction id
- Object id
- Intermediary specific information chaining
- Routing information to, from, via, etc
- Security information
- Auditing
19SOAP Header
ltSOAP-ENVEnvelope gt ltSOAP-ENVHeadergt lthdT
ID xmlnshd"http//www.e1.com"gt 6734564439234
439439439349 lt/hdTIDgt lthdSecurity
xmlnshd"http//www.e1.com"gt ltusernamegtWilnerlt
/usernamegt ltpasswordgtBigDeallt/passwordgt lt/hd
Securitygt lt/SOAP-ENVHeadergt ltSOAP-ENVBodygt
lt/SOAP-ENVBodygt lt/SOAP-ENVEnvelopegt
20Transports
- HTTP
- SMTP (E-Mail)
- FTP
- Files
- Postal Service
- FAX
- DOG
21SOAP Over HTTP
- As specified in SOAP V1.1 note
- HTTP POST message
- SOAPAction HTTP header
- HTTP status code
- 2xx indicates success
- 500 indicates fault
22SOAP Over HTTP Request
POST / HTTP/1.1 SOAPAction "http//www.e1.com/Get
Customer" Content-Type text/xml
charsetutf-8 Host localhost8081 Content-length
706 ltSOAP-ENVEnvelope gt ltSOAP-ENVBodygt lt
ns1GetCustomer xmlnsns1"http//www.e1.com
"gt ltCustomerId xsitype"xsdint"gt 6734
lt/CustomerIdgt lt/ns1GetCustomergt lt/SOAP-ENV
Bodygt lt/SOAP-ENVEnvelopegt
23SOAP Over HTTP Response
HTTP/1.1 200 OK Content-Type text/xml
charsetutf-8 Content-Length 226 ltSOAP-ENVEnvel
ope gt ltSOAP-ENVBodygt ltns1GetCustomerRespon
se xmlnsns1"http//www.e1.com"gt lt
Name xsitype"xsdstring"gt Fred
Flintstone lt/Namegt ltBalance
xsitype"xsddecimal"gt 2349.27 lt/Balancegt
lt/ns1GetCustomerResponsegt lt/SOAP-ENVBodygt lt/
SOAP-ENVEnvelopegt
24Attachments
- Standard way of attaching or including non-XML
data in a Web Services (SOAP) request, e.g. a
picture, an EXCEL file, another XML document,
etc. - Two Approaches
- SOAP with Attachments
- based on MIME with extensions to SOAP and WSDL
- http//www.w3.org/TR/SOAP-attachments
- WS-Attachments
- A Microsoft and IBM proposal
- based on DIME
- A more efficient version of MIME
- http//www-106.ibm.com/developerworks/webservices/
library/ws-attach.html
25SOAP with Attachments
MIME
Standard MIME header
1st MIME part containers SOAP message
...
Other MIME parts container whatever you want
????????
26SOAP with Attachments
- MIME-Version 1.0
- Content TypeMultipart/RelatedboundaryMIME_bound
ary typetext/xml start56987563343_at_progress.com
--MIME_boundary - Content-Type text/xml charsetUTF-8Content-Tran
sfer-Encoding 8bitContent-Id
lt56987563343_at_progress.comgtlt?xml version"1.0"
encoding"UTF-8"?gt - ltSOAP-ENVEnvelope xmlnsSOAP-ENVhttp//sch
emas.xmlsoap.org/soap/envelope/gt - ltSOAP-ENVBodygt
- ltns1GetCustomerPictureResponse
- xmlnsns1"http//www.e1.com"gt
- ltPicture href"cid56987566734_at_progress.com"
/gt - lt/ns1GetCustomerPictureResponsegt
- lt/SOAP-ENVBodygt
- lt/SOAP-ENVEnvelopegt
27SOAP with Attachments
- --MIME_boundary
- Content-Type image/tiff
- Content-Transfer-Encoding binary
- Content-Id lt56987566734_at_progress.comgt
- binary TIFF image
- --MIME_boundary
28Agenda
- Web Services Architecture
- Wire Stack
- Description Stack
- Discovery Stack
- Thats All Folks
Service Orchestration
Service Description
Datatype Definition
Description Stack
29WSDL
Web Service Description Language
- W3C note defacto standard
- http//www.w3.org/TR/WSDL.html
- Service interface
- What can it do?
- Service implementation
- How do I invoke it?
- Service location (optional)
- Where does it reside?
30WSDL
- Service interface maps to business interface
- Generation approaches
- WSDL generated from business interface
- Business interface generated from WSDL (industry
standards)
31WSDL
types
ServiceImplementation
ServiceLocation
service
port
32WSDL
- ltdefinitions .gt
- ltmessages gt ... lt/messagesgt
-
- ltmessages gt ... lt/messagesgt
- ltportType gt lt/portTypegt
-
- ltportType gt lt/portTypegt
- ltbinding gt lt/bindinggt
- ltservicegt lt/servicegt
- lt/definitionsgt
33WSDL
Definitions
- ltdefinitions name"CustomerAdmin"
- targetNamespace
- "http//www.example.com/customer"
- xmlnstns"http//www.example.com/customer"
- xmlnssoap
- "http//schemas.xmlsoap.org/wsdl/soap/"
- xmlnsxs"http//www.w3.org/2001/XMLSchema"
- xmlnsxsi
- "http//www.w3.org/2001/XMLSchema-instance"gt
- xmlns"http//schemas.xmlsoap.org/wsdl/"
-
- lt/definitionsgt
34WSDL
Messages
- ltmessage name"GetCustomer"gt
- ltpart name"CustomerId" type"xsint"/gt
- lt/messagegt
- ltmessage name"GetCustomersResponse"gt
- ltpart name"Name" type"xsstring"/gt
- ltpart name"Balance" type"xsdecimal"/gt
- lt/messagegt
35WSDL
PortType
- ltportType name"CustomerPortType"gt
- ltoperation name"GetCustomer"gt
- ltinput message"tnsGetCustomer"/gt
- ltoutput message"tnsGetCustomerResponse"/gt
- lt/operationgt
- lt/portTypegt
36WSDL
Binding
- ltbinding name"CustomerBinding"
type"tnsCustomerPortType"gt - ltsoapbinding style"rpc" transport
- "http//schemas.xmlsoap.org/soap/http"/gt
- ltoperationgt lt/operationgt
- lt/bindinggt
37WSDL
Binding
- ltoperation name"GetCustomer"gt
- ltsoapoperation soapAction
- "http//www.progress.com/Sports"/gt
- ltinputgt
- ltsoapbody use"encoded
- encodingStyle
- "http//schemas.xmlsoap.org/soap/encoding/"
namespace"http//www.e1.com/customer"/gt - lt/inputgt
- ltoutputgt
- ltsoapbody use"encoded"
- encodingStyle
- "http//schemas.xmlsoap.org/soap/encoding/"
namespace"http//www.e1.com/customer"/gt - lt/outputgt
- lt/operationgt
38WSDL
Service
- ltservice name"CustomerService"gt
- ltport name"CustomerPort" binding"CustomerBindin
g"gt - ltsoapaddress location"http//ww
w.example.com/customer"/gt - lt/portgt
- lt/servicegt
39WSDL Support for Attachments
Binding
- ltbinding name"Customer_Binding" ... /gt
- ltsoapbinding .../gt
- ltoperation name"SetCustomerPicture"gt
- ltsoapoperation ... /gt
- ltinputgt
- ltmimemultipartRelatedgt
- ltmimepartgt
- ltsoapbody parts"CustomerId"
use"encoded" ... /gt - lt/mimepartgt
- ltmimepartgt
- ltmimecontent
- part"CustomerPicture" type"image/tiff"/gt
lt/mimepartgt - lt/mimemultipartRelatedgt
- lt/inputgt
- ltoutputgt lt/outputgt
- lt/operationgt
- lt/bindinggt
40Service Orchestration
- A fancy name for a business process
- SOAP, WSDL, and "discovery mechanism" allow for
loosely integrated Web Services - Business requirement to be able to model and
formally describe complex Web Service
interactions - Specifies the execution order of a collection of
Web Services, e.g. - A travel reservation system
- An mortgage application system
41Service Orchestration
WebServiceClient
- Looks like a Web Service to the outside world
- Accessed using WSDL
- Needs to be flexible and adaptable
- Swap out one service implementation for another
- Requirement for a "process engine" that handles
the flow between Web Services
Web Service
42Service Orchestration
Mortgage Web Service
Receive Mortgage Application
Process Mortgage
Order Appraisal
Order Credit Check
Process Application
Notify Customer
Web Service Invocation
Message passing
43Service Orchestration
- Using standards allow process to be published,
shared, and integrated with other processes - Lots of proposed standards very immature
- WSFL
- http//www.ibm.com/software/solutions/webservices/
pdf/WSFL.pdf - XLANG
- http//msdn.microsoft.com/library/default.asp?url
/library/en-us/bts_2002/htm/bts_gs_content_rtzn.as
p - BPML
- http//www.bpmi.org
- WSCI
- http//www.w3.org/TR/wsci
- BPEL4WS
- http//www.ibm.com/developerworks/library/ws-bpel
44BPEL4WS
- Supercedes XLANG (Microsoft) and WSFL (IBM)
- Subset of BPML
- XML-based programming language for creating an
executable business process - Message oriented
- XML-oriented
- Basic activities
- Receive, reply, invoke
- Assign and copy
- Messages
- Properties (variables)
- Faults throw/catch model
45BPEL4WS
- Structured activities
- Sequences
- Execute sequentially
- Flows with links
- Executes a set of activities in parallel with
dependencies controlled by links - Wait
- For time-out period
- Until a specific date
46BPEL4WS
- Structured Activities
- While
- Execute an activity while a condition is true
- Switch
- Condition behavior based on an expression
- Pick
- Waits for an event and executes the corresponding
activity - Two types of event
- A particular message
- A timeout
47BPEL4WS
- Scopes
- A way of grouping a set of activities
- Can be nested
- Can bind a compensation handler to a scope for
long running transaction support - Containers
- Mechanism for holding messages and passing them
from one step to the next
48BPEL4WS
Document Structure
Process
49BPEL4WS
- ltprocess name"purchaseOrderProcess" gt
- ltpartnersgt ltpartner name"Customer"
- serviceLinkType"lnsMortgageAppLT"
- myRole"MortgageService"/gt
- ltpartner name"CreditCheckProvider"
- serviceLinkType"lnsCreditCheckLT"
- myRole"CreditCheckRequester"
- partnerRole"CreditCheckService"/gt
- lt/partnersgt
- ltcontainersgt
- ltcontainer name"MortgageApp"
messageType"lnsPOMessage"/gt - lt/containersgt
50BPEL4WS
- ltsequencegt
- ltreceive partner"customer"
- portType"lnsMortgageAppPT"
- operation"sendMortgageApp"
- container"MortgageApp"gt
- lt/receivegt
- ltinvoke partner"CreditCheckProvider"
- portType"lnscomputePricePT"
- operation"initiateCreditCheck"
- inputContainer"MortgageApp"gt
- lt/sequencegt
- lt/processgt
51Agenda
- Web Services Architecture
- Wire Stack
- Description Stack
- Discovery Stack
- Thats All Folks
Discovery Stack
52Web Services Discovery
- Supports the Publish, and Find
- Provides the information needed for Bind
- Discovery Scenarios
- Global Directory semantic Web
- Private Business Exchange
- E-marketplace
- Consortium
- Standards body
- Portal server side registry of business
services - Business Partners client side registry of
business partners - Enterprise/Departmental
- Test Environment
53Web Services Discovery
- Multiple approaches just need access to the
WSDL document - Request it from the Provider
- FTP
- E-mail
- Web Site, e.g. Open Edge WSTK
- Web site based repository at well-known site
- http//www.xmethods.net
- http//www.salcentral.com
- Site specific registry at service provider site
- IBM's ADS
- Microsoft's DISCO
- Web Service Inspection Language WSIL
- Centralized dynamic registry
- Universal Description Discovery and Integration
(UDDI)
54WSIL Discovery
Web Server
Web Server
ApplicationServer
Web Service Client
HTTP Listener
SOAP Processor
BusinessLogic
Business Interface
55WSIL Discovery
Web Server
Web Server
ApplicationServer
Web Service Client
HTTP Listener
SOAP Processor
BusinessLogic
Business Interface
56Web Services Inspection Language (WSIL)
- Proposed by IBM and Microsoft
- http//www.ibm.com/developerworks/library/ws-wsils
pec.html - When you know the host that you want to work
with, e.g. www.progress.com - By convention look for inspection.wsil, e.g.
http//www.progress.com/inspection.wsil - Supports linking of documents
Enterprise
Product Unit
Department
57WSIL
- lt?xml version"1.0"?gt
- ltinspection
- xmlns"http//schemas.xmlsoap.org/ws/2001/10/in
spection/" - xmlnswsilwsdl
- http//schemas.xmlsoap.org/ws/2001/10/inspec
tion/wsdl"gt - ltservicegt
- ltname xmllang"en-US"gtTechSupportlt/namegt
- ltdescription
- referencedNamespace
- "http//schemas.xmlsoap.org/wsdl/
" - location
- "http//www.progress.com/TechSupport.w
sdl"gt - lt/descriptiongt
- lt/servicegt
- lt/inspectiongt
58UDDI
Universal Description, Discovery, and Integration
- Framework for registering standards and services,
discovering businesses, and integrating business
services - SOAP-based API
- Smart searches via categories and identifiers,
e.g. find all bicycle manufactures - http//www.uddi.org
- 220 member companies, including Progress
- Replicated registry available today
- IBM
- Microsoft
- SAP
59UDDI
- Supports dynamic discovery service provider can
be determined at runtime - e.g. Get the expense data for all subsidiaries
- Several implementations available today
- Open Source
- Microsoft and IBM
- Several others vendors, e.g. Systinet, Oracle,
Cape Clear - Register/Find using
- Browser
- SOAP-based API
60UDDI
1.
5.
Service requestors uses the fetched data to
access the service they need.
Business Analysts, Standard Bodies, Service
Providers register descriptions of different
kinds of services.
UDDI Business Registry
4.
Service requestors query registry to find the
services that they want.
"Business" registers which services they support.
2.
UBR assigns a UUID or other unique key to each
service and business
3.
61UDDI
- UDDI Business Registry Data Model
- White Pages
- Basic contact information, e.g. Name, address,
contact info - Yellow Pages
- Categorizations used for discovery, e.g. bicycle
manufacturer, book publisher, etc. - Green Pages
- Technical details on the services that the
business provides and how to access the service - Location of Web Service, e.g. the WSDL document
- References a tModel
62UDDI
- Service Type Registration - tModels
- Represents a set of technical specifications
- What a programmer needs to know
- Provided by standards bodies, market places,
individual programmers, individual companies,
etc. - A business or service that supports a tModel
supports the corresponding specification - A Tmodel specification might be a WSDL document
- Also used for categories and identifiers
63UDDI Data Model
Business Entity
All entries have UUID-based keys
White Pages
Basic Business InfoIdentifiersCategories
Binding Template
Green Pages
accessPoint
tModelKey
64UDDI Categories
- Allows a registry entry to be associated with a
industry, product, or geographic code set - Search by category
- Supported for Business Entity, Business Service,
and tModel - Each category entry contains
- Name
- Value
- Classification scheme via a tModel reference
- NAICS industries, e.g. goat farming
- UNSPC service and products, e.g. ice cream
machine - ISO 3166 geographic location, e.g. US-NH
- UBR specific
65UDDI Categories
- Name "Skis"
- Value "49151502"
- tModelKey"uuid4e49a8d6-d5a2-4fc2-93a0-0411d8d19e
388"
66UDDI Identifiers
- Used to uniquely identify a business or
specification - Supported for Business Entity, and tModels
- Identifier Schemes
- DUNS Dun Bradstreet Number
- Thomas Register
- IRS Tax-Id
- UBR Specific, e.g. marketplace unique id
67UDDI Data Model Example
Business Entity
NameSki TownCategories Nameskis Value
49151502 tModelKey
White Pages
tModel
UNSPSCwww.unspsc.com
tModel
httpskitown.wsdlCategories wsdlspec
uddi-orgtype tmodelKey
Binding Template
Green Pages
accessPoint https//www.skitown.com/purchasing
tModelKey
68UDDI Api
- For all data model objects business entity,
business service, binding, tModel - Inquiry API and publisher API supports find, get,
save, and delete operations - Smart search
- By name
- By category
- By identifier
- By key
69Agenda
- Web Services Architecture
- Wire Stack
- Description Stack
- Discovery Stack
- Thats All Folks
70Summary
- Standards are still evolving
- Working to solve the hard business integration
problems - Look to tools to do the heavy lifting
71Web Services Resources
- Books
- Java Web Services by David Chappell Tyler
Jewell - Professional XML Web Services by Patrick
Cauldwell et al - Essential XML Quick Reference by Aaron Skonnard
- Links
- http//www.xml.com
- http//www.webservices.org
- http//www.xml.com
- http//www.ws-i.org
- http//www.soapware.org
- http//www.xmethods.com
72!
All questionsanswered