Title: Web Services: A Practical Guide
1Web Services A Practical Guide
Anne Thomas Manes CTO, Systinet (formerly known
as Idoox)
2Agenda
- What is a Web service?
- XML
- SOAP
- WSDL
- UDDI
- Use Cases
- Questions
3What is a Web Service?
"Web services are loosely coupled software
components delivered over Internet standard
technologies."
Businesses that ignore its potential, or decide
to sit out its early stages, will find themselves
outpaced by rivals who take advantage of Web
services to improve their agility and even to
transform themselves into new kinds of
enterprises."
Daryl Plummer, Gartner June 15, 2001
4New Age of Distributed Computing
- Convergence of two technologies
- The Web
- Universal communication
- Loose coupling
- HTTP, XML
- Service-oriented computing
- Exposing data and business logic through a
programmable interface - RPC, RMI, CORBA, MOM
5Web Services Characteristics
- Programmatic interface
- Using standard Web protocols
- Loosely-coupled connections
- i.e., XML Messaging
6Core Web Services Technologies
- XML data format
- SOAP protocol
- WSDL service descriptions
- UDDI registry
7Web Services Technologies
UDDI Registry
WSDL
Points to description
Points to service
Describes Service
Finds Service
Web Service
Service Consumer
SOAP
Communicates with XML Messages
8XML
- Extensible Markup Language
- Self-describing data format
- Independent of
- Platform
- Infrastructure
- Language
- Tool
9XML Example
ltnamegt ltfirstgtAnnelt/firstgt ltmigtTlt/migt
ltlastgtManeslt/lastgt lt/namegt
10SOAP
- Simple Object Access Protocol
- Mechanism to send XML messages
- Provides the interface to a Web service
- Document
- RPC
11SOAP Details
- Envelope
- Header
- Body
- Transport binding framework
- HTTP
- Data encoding/literal
- RPC programming convention
12SOAP Variants
- SOAP 1.1
- SOAP w/ Attachments (SwA)
- ebXML Message Service
- W3C SOAP 1.2
13SOAP 1.1 Request via HTTP
POST /MyStockQuote HTTP/1.1 Host
my.com Content-Type text/xml charsetutf-8 Con
tent-Length nnnn SOAPAction http//my.com/getQu
ote ltsoapenvEnvelope xmlnssoapenvhttp//
schemas.xmlsoap.org/soap/envelope/gt
ltsoapenvBodygt ltmGetLastTradePrice
xmlnsmhttp//my.com/MyStockQuote.wsdl/
xmlnsxsdhttp//my.com/MyStockQuote.xsd/gt
ltxsdsymbolgtSUNWlt/xsdsymbolgt
lt/mGetLastTradePricegt lt/soapenvBodygt lt/soapenv
Envelopegt
14SOAP 1.1 Response by HTTP
HTTP/1.1 200 OK Content-Type text/xml
charsetutf-8 Content-Length
nnnn ltsoapenvEnvelope xmlnssoapenvhttp//s
chemas.xmlsoap.org/soap/envelope/gt
ltsoapenvBodygt ltmGetLastTradePriceResponse
xmlnsmhttp//my.com/MyStockQuote.wsd
l/ xmlnsxsdhttp//my.com/MyStockQuot
e.xsd/gt ltxsdpricegt13.68lt/xsdpricegt
lt/mGetLastTradePriceResponsegt
lt/soapenvBodygt lt/soapenvEnvelopegt
15New Java APIs for SOAP
- JAXM JSR 67 (final draft)
- Low level API
- For use inside SOAP tools
- Enables pluggable SOAP stacks
- Other XML messaging systems
- JAX/RPC JSR 101
- In community review
- Programming API
- Supports both RPC and document style
16WSDL
- Web Services Description Language
- Describes a Web service
- What it does
- How to communicate with it
- Where to find it
17WSDL Details
- Schema description
- Types data type information
- Abstract service description
- Message message formats
- PortType abstract set of operations/messages
- Binding concrete mapping to protocol
- Mapping to an Implementation
- Port address for a binding
- Service collection of ports
18WSDL Example
lt?xml version1.0 encodingUTF-8?gt ltdefinition
s namemyStockQuote" targetNamespacehttp//my
.com/myStockQuote.wsdl xmlnshttp//schemas.x
mlsoap.org/wsdl/ xmlnstnshttp//my.com/myS
tockQuote.wsdl xmlnsxsdhttp//my.com/mySto
ckQuote.xsd xmlnssoaphttp//schemas.xmlsoa
p.org/wsdl/soap/gt
19lttypesgt
lttypesgt ltschema targetNamespacehttp//m
y.com/myStockQuote.xsd
xmlnshttp//www.w3.org/1999/XMLSchemagt
ltelement nameTradePriceRequestgt
ltcomplexTypegt ltallgt ltelement
namesymbol typestring/gt lt/allgt
lt/complexTypegt lt/elementgt
ltelement nameTradePricegt
ltcomplexTypegt ltallgt ltelement
nameprice typedouble/gt lt/allgt
lt/complexTypegt lt/elementgt
lt/schemagt lt/typesgt
20ltmessagegt and ltportTypegt
ltmessage nameGetLastTradePriceInputgt ltpart
namebody elementxsdTradePriceRequest/gt lt/me
ssagegt ltmessage nameGetLastTradePriceOutputgt
ltpart namebody elementxsdTradePrice/gt lt/m
essagegt ltportType nameMyStockQuotePortType"gt
ltoperation nameGetLastTradePrice"gt
ltinput message"tnsGetLastTradePriceInp
ut"/gt ltoutput message"tnsGetLast
TradePriceOutput"/gt lt/operationgt lt/portTypegt
21ltbindinggt
ltbinding nameMyStockQuoteSoapBinding"
type"tnsMyStockQuotePortType"gt ltsoapbinding
styledocument transporthttp//schemas.x
mlsoap.org/soap/http/gt ltoperation
nameGetLastTradePrice"gt ltsoapoperation
soapActionhttp//my.com/getQuote/gt
ltinputgt ltsoapbody useliteral/gt
lt/inputgt ltoutputgt ltsoapbody
useliteral/gt lt/outputgt
lt/operationgt lt/bindinggt
22ltservicegt
ltservice nameMyStockQuoteService"gt
ltdocumentationgtMy Stock Quote Servicelt/documentati
ongt ltport nameMyStockQuotePort"
bindingtnsMyStockQuoteSoapBindinggt
ltsoapaddress locationhttp//my.com/my
StockQuote/gt lt/portgt lt/servicegt lt/definiti
onsgt
23Java API for WSDL
- JWSDL
- JSR 110 still in development
- Based on IBMs WSDL4J
- Available from developerWorks
- API to access and manipulate WSDL
24UDDI
- Universal Description, Discovery and Integration
- A registry for Web Services
- Helps you find a Web Service and its description
(WSDL) - Search by business
- Search by service type
25 Public Registry
UDDI Business Registry
26UDDI Private Registries
- Registries for private services within enterprise
or business community - Extended UDDI to support
- Privacy
- Security
- Data integrity
- Reliability
- Manageability
- Richer query capabilities
27UDDI Versions
- UDDI V1 Final June 2001
- UDDI V2 Draft June 2001
- Adds custom categorizations, business
associations, better query - UDDI V3 Draft expected Q1 2002
- Adds security, internationalization, better
query, subscriptions, notifications, and
cross-registry references
28UDDI Data Model
businessEntity
tModel
businessService
bindingTemplate
29UDDI API
- SOAP Messages
- Publishing API
- ltsave_xxxgt
- ltdelete_xxxgt
- Inquiry API
- ltfind_xxxgt (browse)
- ltget_xxxgt (drill down)
- UDDI4J
- JAXR
30- Jump to UDDI presentation
31Use Cases
- Browse for sporting goods business
- Drill down to bindingTemplate, get associated
tModel - Start with tModel
- Find services with tModel in categoryBag
- Start with Business
- Drill down
32Getting Started
- Systinet Web Applications and Services Platform
(WASP) - Complete platform for Web Services
- Advanced SOAP implementation
- WSDL-based tools
- UDDI V2 service
33Idoox WASP
- WASP Server
- Lite and Advanced Editions
- Java, C, JavaScript
- WASP Developer
- Command line tools
- Plug-ins for Forte and JBuilder
- WASP UDDI
- Standard and Enterprise Editions
34WASP Server, Advanced Edition
- J2EE integration
- EJB, JNDI, JDBC, JMS support
- Remote references
- Security
- SSL and GSS-API/SPKM
- Pluggable protocols
- HTTP, HTTPS, JMS, SMTP
- Excellent interoperability
- Apache, .NET, Excel, etc.
35Web Services Runtime
UDDI
register service
Any type of application that implements the
business logic
WSDL
find service
DB
Action Processors
Client
SOAP Interface
SOAP
Proxy
Action Processors
Legacy
Application Browser Device etc.
Web Service Container (Web/Application Server)
36J2EE Support
Traditional J2EE Processing
EJB Client
J2EE
JNDI Lookup
JNDI
Create local proxy
Execute methods
EJB
37J2EE Support
WASP J2EE Processing
EJB Client
J2EE
JNDI Lookup
Create local proxy
JNDI
Execute methods
38WASP Developer for Forte
- Seamless integration with NetBeans and Sun Forte
for Java - Point-and-click tools
- Generate WSDL from Java class
- Generate Java proxies and skeletons from WSDL
- Generate all SOAP interfaces
- One click deployment
39Web Services Development
WSDL
WSDL generated from Java Interface
or vice versa
SOAP client server code generated from WSDL
Java Code
Client
SOAP Interface
SOAP Proxy
Class Servlet JSP EJB
UDDI registration refers to WSDL
UDDI
40WASP UDDI
- Standard Edition
- Reference implementation of UDDI V2
- Supports Oracle, PostgreSQL, other JDBC-enabled
databases - Enterprise Edition
- Enterprise extensions
- Superset of UDDI V2
- Security (data integrity, authentication, and
authorization) - SuperQuery
41Summary
- Core technologies
- XML, SOAP, WSDL, and UDDI
- Real products exist today
- See www.systinet.com
- Create Plug and Play applications
- Enabling the Dynamic Enterprise
42Questions?