. . .
Chris Armstrong ATC Enterprises, Inc.
1751 West County Road B, Suite 310
Modeling Web Services
Modeling Web Services
with UML
with UML
. . .
Agenda
Agenda
•
What are Web Services?
•
What is SOAP?
•
What is UDDI?
•
What is WSDL?
•
What does all of this have to do with each other?
. . .
What is a Web Service?
What is a Web Service?
•
Represents a specific business function
•
Exposed by a company
•
Usually through an Internet connection
•
Provided to another company or software application to
consume
“Web services are becoming the programmatic backbone for
electronic commerce…”
. . .
What are Web Service Applications?
What are Web Service Applications?
•
Hyper-applications that are
• Designed
• Assembled
• Executed
dynamically at run-time using web services
• Especially in a B2B environment
•
Use emerging industry standards
• Extensible Markup Language (XML)
• Simple Object Access Protocol (SOAP)
• Web Services Description Language (WSDL)
. . .
Web Services Business Model
Web Services Business Model
Service Provider
Publish Web Service
Register Web Service
Find Web Service
Service Broker
. . .
Fundamental Web Service Concepts
Fundamental Web Service Concepts
WSDL, SOAP
Bind
UDDI, WSDL,
DISCO
Find
UDDI
Publish
Standard
Service
. . .
Realization of Web Services Business Model
Realization of Web Services Business Model
Find Web Service Consume Web Service
Publish Web Service Register Web Service
UDDI W SDL SOAP
. . .
Web Services Architectural Mechanisms
Web Services Architectural Mechanisms
Web Discovery Services Web Description Services Web Wire Services. . .
Web Wire Services
Web Wire Services
Inter Process Communication <<analysis mechanism>>
Security
<<analys is mec hanis m>>
Reliability
<<analysis mechanism>>
Routing
. . .
IPC Wire Services
IPC Wire Services
Data Encoding <<design mechanism>>
Data Transport <<design mechanism>>
Remote Procedure Call <<des ign mechanism>>
Int er Proc ess Communic ation <<analysis mechanism>> SOA P <<implementation mechanism>> HTTP <<implementation mechanism>> XML <<implementation mechanism>>
. . .
SOAP Wire Services
SOAP Wire Services
SOAP
. . .
Web Description Services
Web Description Services
Business Process Orchestration <<design m echanism>>
Workflow Automation <<analysis mechanism>>
Message Sequencing <<design m echanism>>
Service Capability Configuration <<design mechanism>>
Service Descript ion <<design mechanism>> WSFL <<implementation mechanism>> BizTalk <<implementation mechanism>> WSDL
<<im plementation mechanism>> Applicat ion Integration
<<analysis mechanism>>
UDDI
. . .
Web Discovery Services
Web Discovery Services
Disc overy Services <<analy sis mechanism>>
Directory Service <<design mechanism>> Inspection Service <<design mechanism>> UDDI <<implementation mechansim>>
. . .
What is SOAP?
What is SOAP?
•
Simple Object Access Protocol (SOAP)
•
Standard for invoking services across the web
•Uses HTTP for transport
•
Uses XML for data encoding
•Extensible
. . .
Benefits of SOAP
Benefits of SOAP
•
Can invoke components residing in many architectures
•
DCOM
•
CORBA
•
EJB
•
Perl
!
Heterogeneous “glue”
. . .
Benefits of SOAP
Benefits of SOAP
•
Uses industry standards
•
HTTP
• Works through firewalls!
•
XML
•
Platform-independent
•
Can be invoked from any platform
• Browser
• Desktop application
. . .
Web Application Extensions (WAE) for UML
Web Application Extensions (WAE) for UML
A pplet A pplic ation < < A pplic ation> > Client P age COM Objec t < < COM Objec t> > E JB Objec t < < E JB Objec t> >
Form S erver P age
S es s ion < < S es s ion> >
. . .
Standard HTTP Form POST
Standard HTTP Form POST
Client P age Form Client P age Re nderer < < s ub mit> > < < build> >. . .
SOAP Request from Browser
SOAP Request from Browser
-
-
Structure
Structure
Form S OA P Reques t (from S OA P ) S OA P Res pons e (from S OA P ) IS OA P P ro x y - newReques t() : S OA P Reques t- pos tReques t(S OA P Reques t) : S OA P Res pons e + invok eM ethod() < < interfac e> > XM L P ars er Cl ient P age Renderer < < s ubm it> > Client P age < < build> >
. . .
SOAP Request from Browser
SOAP Request from Browser
-
-
Behavior
Behavior
: Client P age : IS OA P P rox y : S OA P Reques t
: XM L P ars er
:
IS OA P Trans lator
3: new 1: invok eM eth od( )
2: newReques t( )
5: pos tReques t(S OA P Reques t) 4: enc ode
. . .
SOAP Request on Server
SOAP Request on Server
-
-
Structure
Structure
S OA P Re quest (from S OA P ) S OA P Res pons e (from S OAP ) XM L P ars er + dec ode() + enc ode() IS OA P Trans lator+ rec eiveReques t(S OA P Reques t) - s endRes pons e() : S OA P Res po... - loc ateCom ponent()
- buildRes pons e()
< < interfac e> >
ICom ponentInterfac e
+ m ethod()
(fr om S O A P )
. . .
SOAP Request on Server
SOAP Request on Server
-
-
Behavior
Behavior
: IS OA P P rox y : IS OA P Trans lator : XM L P ar s er : ICom ponentInterfac e 1: rec eiveReques t(S OA P Reques t)2: dec ode( ) 3: l ocat eCompon ent( )
4: m ethod( ) 5: bu ildRes pons e( )
. . .
SOAP Process View
SOAP Process View
Cli ent P ro c es s < < proc es s > > HTTP S erver < < proc es s > > < < proc es s > > CORB A S erver < < p roc es s > > EJ B S erver < < p roc es s > >. . .
SOAP Deployment View
SOAP Deployment View
Client M ac hine
B ro wse r P ro ce ss
Firewall
W eb S er ver A pplic ation S erver
. . .
What is WSDL?
What is WSDL?
•
Web Services Description Language (WSDL)
•
Way to describe web services
• Where do they reside locally
• What are they called
• How are external operations bound to internal operations
• How data is encoded
• How operation is invoked
•
WSDL is similar to an interface in a component architecture, but
also includes information on
. . .
What is WSDL?
What is WSDL?
•
History
• Started as Service Description Language (SDL)
• Part of early SOAP efforts
• Turned into Service Contract Language (SCL)
• Currently called Web Services Description Language (WSDL)
•
In Apache SOAP, use XML Deployment Descriptors
• Register with ServiceManagerClient in org.apache.soap.server
package
•
WSDL extensions defined
• HTTP GET
. . .
WSDL Generation
WSDL Generation
•
Development tool vendors provide WSDL generation
tools
•
Microsoft VisualStudio 6.0
• Uses Web Services Meta Language (WSML) for COM binding on
server side
•
Microsoft VisualStudio.NET
•
IBM Web Services Tool Kit (WSTK)
. . .
WSDL Schema
WSDL Schema
–
–
High
High
-
-
Level
Level
definitions targetNamespace types portType WSDL schema documentation message name documentation binding name 0..1 0..n 0..1 0..1 0..1 0..n 0..n 0..n 0..n0..n. . .
WSDL Schema
WSDL Schema
–
–
Types
Types
types
documentation
schema
att ributeFormDefault elem ent Form Default targetNam espace sequence element name minOc curs maxOccurs nillable 0..1 0..n 0..n 0.. n 0.. n 0..n 0..n 0..1 +type0..10..1
. . .
WSDL Schema
WSDL Schema
–
–
Messages
Messages
message name documentation part name element name minOccurs maxOccurs nillable complexType 0..n 0..n 0..1 0..1 0..1 +type 0..1. . .
WSDL Schema
WSDL Schema
–
–
Port Types and Bindings
Port Types and Bindings
portType name operation name documentation message name binding name complexType 1.. n 1.. n 1 +output 0.. 1 0.. 1 +input 0..10..1 0..1 +fault 0..1 1 0..1 +t ype 0..1. . .
UML for WSDL
UML for WSDL
•
Visually model key portions of WSDL definition
•
Other details can be modeled using tagged values
•
Use one class for overall service description
•
Use <<wsdl service>> stereotype
•
For each element, use <<element>> stereotype on attributes
• For elements that are complexTypes, model as separate class with
<<element>> stereotype
•
For each message, use <<message>> stereotype on
. . .
UML for WSDL
UML for WSDL
•
Use one class for each portType
•
Use <<wsdl portType>> stereotype
•Attach to service with aggregation
•For each operation, use an operation
•
Use one class for each binding
•
Use <<wsdl binding>> stereotype
•
Attach to service with aggregation with <<port>> stereotype
•For each operation, use an operation
. . .
Sample UML for WSDL
Sample UML for WSDL
–
–
High
High
-
-
Level
Level
ZIPCodeResolver <<wsdl service>> ZIPCodeResolverHTTPGet <<wsdl binding>> ZIPCodeResolverHTTPGet <<wsdl portType>> ZIPCodeResolverHTTPPost <<wsdl binding>> ZIPCodeResolverSOAP <<wsdl binding>> ZIPCodeResolverHTTPPost <<wsdl port Type>> ZIPCodeResolverSOAP <<ws dl portType>> <<port>> <<port>> <<port>>. . .
Sample UML for WSDL
Sample UML for WSDL
–
–
Detailed
Detailed
ZIPCodeResolverSOAP FullZipCode() <<wsdl binding>> ZIPCodeResolverSOAP FullZipCode() <<wsdl portType>> ZIPCodeRes olver<<elem ent>> FullZipCode
<<elem ent>> FullZipCodeResponse <<elem ent>> CorrectedAddressHTML
<<elem ent>> CorrectedAddressHTMLResponse
<<message>> FullZipCodeHt tpGetIn() <<message>> FullZipCodeHt tpGetOut () <<message>> FullZipCodeHt tpP ost In() <<message>> FullZipCodeHt tpP ost Out () <<message>> FullZipCodeSoapIn() <<message>> FullZipCodeSoapOut () <<wsdl service>> <<port>> USPSAddress <<element>> Street <<element>> City <<element>> State <<element>> ShortZIP <<element>> FullZIP <<element>>
. . .
Sample UML for WSDL
Sample UML for WSDL
–
–
Context
Context
ZIPCodeResolver <<wsdl service>> IZIPCodeResolver FullZipCode() ShortZipCode() CorrectedAddress() CorrectedAddress() VersionInfo() <<Int erface>> ZIPCodeResolver ZIPCodeResolver Prox y <<derive>>. . .
What is UDDI?
What is UDDI?
•
Universal Description, Discovery and Integration (UDDI)
•
A specification for distributed Web-based information registries
of Web services
•
Collaborative initiative
• IBM
• Microsoft
• Ariba
•
Create a global, platform-independent, open framework to
rapidly accelerate the global adoption of B2B e-commerce
. . .
What is UDDI?
What is UDDI?
•
Similar to DNS for domain names
•
Except works for web services instead
•
Business service registry
•
Logically centralized
•Physically distributed
. . .
UDDI Logical Architecture
UDDI Logical Architecture
businessEntity
businessService
. . .
UDDI Leaders
UDDI Leaders
•
IBM
•
UDDI4J
•
Microsoft
•
UDDI for .NET
. . .
UDDI4J Overview
UDDI4J Overview
•
Open source implementation of UDDI for Java by IBM
•
Provides an API to interact with a UDDI registry
•
Generates and parses messages sent to and received
from a UDDI server
•
Requirements
•
Apache SOAP 2.1 or later
•JDK 1.2.2 or later
. . .
UDDI4J Key Components
UDDI4J Key Components
client datatype request response util UDDIElement UDDIException. . .
UDDI4J Key Components
UDDI4J Key Components
•
uddi.client
package
• Especially UDDIProxy class
• Methods map to the UDDI Programmer’s API Specification
•
uddi.datatype
package
• Contains core UDDI datatypes to send and receive data from a UDDI
server
•
uddi.request
package
• Used internally by UDDIProxy for sending messages to a UDDI server
•
uddi.response
package
. . .
Sample UDDI Usage
Sample UDDI Usage
–
–
Inquire
Inquire
–
–
Behavior
Behavior
: Get Business Name : UDDIP roxy : Busi nessLi st :
BusinessInfos : BusinessInfo BusinessInfo : Vector 1: UDDIProxy( ) 2: setInquiryURL(url : String)
3: find_business(name : String, findQualifiers : FindQualifiers, maxRows : int) 4: getBusinessInfos( )
5: getBusinessInfoVector( )
7: getNameString( ) 6: elementAt(arg0 : int)
. . .
Sample UDDI Usage
Sample UDDI Usage
–
–
Inquire
Inquire
–
–
Structure
Structure
Get Business Name BusinessList getBusinessInfos() Business Infos getBusinessInfoVect or() businessInfos URL UDDIProxy UDDIProxy() find_business () setInquiryURL() inquiryURL Vector element At() businessInfo BusinessInfo getNameString(). . .
Apache SOAP Overview
Apache SOAP Overview
–
–
Main Packages
Main Packages
encoding messaging providers rpc server transport util soap (from apache). . .
Apache SOAP Overview
Apache SOAP Overview
–
–
Main Classes
Main Classes
Constants Body Fault Envelope AttributeHandler HeaderSOA PExc eption Utils -body -attrHandler -at trHandler -attrHandler -at trHandler -header
. . .
SOAP Usage by UDDI
SOAP Usage by UDDI
–
–
Part 1
Part 1
: FindBusiness : Get Business
Name
: UDDIProxy
1: find_business(name : String, findQualifiers : FindQualifiers, maxRows : int) 2: FindBusiness( )
3: setName(s : String)
4: setFindQualifiers(s : FindQualifiers) 5: setMaxRows(s : int)
. . .
SOAP Usage by UDDI
SOAP Usage by UDDI
–
–
Part 2
Part 2
: UDDIProxy sendEnv : Envelope sendBody : Body bodyEntry : Vector Add passed Element 1: send(el : Element, inquiry : boolean)2: Envelope( )
3: Body ()
4: Vector( )
. . .
SOAP Usage by UDDI
SOAP Usage by UDDI
–
–
Part 3
Part 3
: UDDIProxy sendBody : Body soapMessage : Message response : Element 3: get transport 1: setBodyEntries(bodyEntries : Vector) 2: Message( ) 4: setSOAPTransport(st : SOAPTransport) 5: Element(). . .
SOAP Usage by UDDI
SOAP Usage by UDDI
–
–
Part 4
Part 4
2: receiveEnvelope( ) : UDDIP roxy s oapMes sage :
Message respEnv : Envelope respBody : Body respBodyEntries : Vector
1: send(url : URL, actionURI : String, env : Envelope)
3: getBody( )
4: getBodyEntries( )
. . .
SOAP Usage by UDDI
SOAP Usage by UDDI
–
–
Structure
Structure
Get Business Name
FindBusiness FindBusiness() setFindQualifiers() setMaxRows() setName() Body Body() getBodyEnt ries() setBodyEnt ries() Envelope Envelope() -body Vector Vector() add() first Element () Message Message() receiveEnvelope() send() SOAPTransport <<Interface>> st UDDIProxy find_business() send() transport Element Element()
. . .
SOAP Message Sending
SOAP Message Sending
–
–
Part 1
Part 1
SOAP Client : Message st :
SOAPHTTPConnection 1: send(url : URL, actionURI : String, env : Envelope)
2: SOAPHTTPConnection()
3: s end(sendTo : URL, act ion : String, headers : Hashtable, env : Envelope, smr :
. . .
SOAP Message Sending
SOAP Message Sending
–
–
Part 2
Part 2
: Mes sage st :
SOA PHTTPConnec tion
payloadSW : StringWriter
env : Envelope
1: send(sendTo : URL, action : String, headers : Hashtable, env : Envelope,
smr : S OAPMappingRegistry, c tx : SOA PContext )
2: St ringW riter( )
. . .
SOAP Message Sending
SOAP Message Sending
–
–
Part 3
Part 3
Constants.HEADER _AUTHORIZATION st : SOAPHTTPConnection headers : Hashtable Constants.HEADER _SOAP_ACTION 3: get userName 4: get password 1: Hashtable( )2: put(arg0 : Object, arg1 : Object)
. . .
SOAP Message Sending
SOAP Message Sending
–
–
Part 4
Part 4
1: TransportMessage(envelope : String, ctx : SOA PContext, headers : Hashtable) st :
SOA PHTTPConnect ion
msg :
TransportMessage
: HTTPUtils
2: save( )
. . .
SOAP Message Sending
SOAP Message Sending
-
-
Structure
Structure
SOAP Client SOAPHTTPConnection password : String userName : String SOAPHTTPConnection() send() SOAPTransport send() <<Interface>> Message send() st StringWriter StringWriter() URL SOA PMappingRegistry SOA PContext TransportMessage TransportMessage() save(). . .
Web Resources