• No results found

Modeling Web Services with UML

N/A
N/A
Protected

Academic year: 2021

Share "Modeling Web Services with UML"

Copied!
58
0
0

Loading.... (view fulltext now)

Full text

(1)

. . .

Chris Armstrong ATC Enterprises, Inc.

1751 West County Road B, Suite 310

Modeling Web Services

Modeling Web Services

with UML

with UML

(2)

. . .

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?

(3)

. . .

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…”

(4)

. . .

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)

(5)

. . .

Web Services Business Model

Web Services Business Model

Service Provider

Publish Web Service

Register Web Service

Find Web Service

Service Broker

(6)

. . .

Fundamental Web Service Concepts

Fundamental Web Service Concepts

WSDL, SOAP

Bind

UDDI, WSDL,

DISCO

Find

UDDI

Publish

Standard

Service

(7)

. . .

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

(8)

. . .

Web Services Architectural Mechanisms

Web Services Architectural Mechanisms

Web Discovery Services Web Description Services Web Wire Services
(9)

. . .

Web Wire Services

Web Wire Services

Inter Process Communication <<analysis mechanism>>

Security

<<analys is mec hanis m>>

Reliability

<<analysis mechanism>>

Routing

(10)

. . .

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>>

(11)

. . .

SOAP Wire Services

SOAP Wire Services

SOAP

(12)

. . .

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

(13)

. . .

Web Discovery Services

Web Discovery Services

Disc overy Services <<analy sis mechanism>>

Directory Service <<design mechanism>> Inspection Service <<design mechanism>> UDDI <<implementation mechansim>>

(14)

. . .

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

(15)

. . .

Benefits of SOAP

Benefits of SOAP

Can invoke components residing in many architectures

DCOM

CORBA

EJB

Perl

!

Heterogeneous “glue”

(16)

. . .

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

(17)

. . .

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> >

(18)

. . .

Standard HTTP Form POST

Standard HTTP Form POST

Client P age Form Client P age Re nderer < < s ub mit> > < < build> >
(19)

. . .

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> >

(20)

. . .

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

(21)

. . .

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 )

(22)

. . .

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( )

(23)

. . .

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 > >
(24)

. . .

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

(25)

. . .

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

(26)

. . .

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

(27)

. . .

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)

(28)

. . .

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
(29)

. . .

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

(30)

. . .

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
(31)

. . .

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
(32)

. . .

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

(33)

. . .

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

(34)

. . .

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>>
(35)

. . .

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>>

(36)

. . .

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>>
(37)

. . .

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

(38)

. . .

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

(39)

. . .

UDDI Logical Architecture

UDDI Logical Architecture

businessEntity

businessService

(40)

. . .

UDDI Leaders

UDDI Leaders

IBM

UDDI4J

Microsoft

UDDI for .NET

(41)

. . .

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

(42)

. . .

UDDI4J Key Components

UDDI4J Key Components

client datatype request response util UDDIElement UDDIException
(43)

. . .

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

(44)

. . .

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)

(45)

. . .

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()
(46)

. . .

Apache SOAP Overview

Apache SOAP Overview

Main Packages

Main Packages

encoding messaging providers rpc server transport util soap (from apache)
(47)

. . .

Apache SOAP Overview

Apache SOAP Overview

Main Classes

Main Classes

Constants Body Fault Envelope AttributeHandler Header

SOA PExc eption Utils -body -attrHandler -at trHandler -attrHandler -at trHandler -header

(48)

. . .

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)

(49)

. . .

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( )

(50)

. . .

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()
(51)

. . .

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( )

(52)

. . .

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()

(53)

. . .

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 :

(54)

. . .

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( )

(55)

. . .

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)

(56)

. . .

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( )

(57)

. . .

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()
(58)

. . .

Web Resources

Web Resources

• UDDI • www.uddi.org • uddi.microsoft.com • www.ibm.com/services/uddi • SOAP • www.soap.org • www.soaprpc.com • www.soapware.org • www.soapclient.com • www.soap-wrc.com • Web Services • www.webservices.org • www-106.ibm.com/developerworks/webservices

References

Related documents

In this thesis work, we designed and developed a Credit Card Web Service using SOAP, WSDL and UDDI – standards defined in the Web Services community. We also presented a viable

Static URI, HTML, HTTP WWW Web services RDF, RDFS, OWL Semantic Web UDDI, WSDL, SOAP Web Services Dynamic Semantic Service registries. Service access interface Communication

Kommunikation und verteilte Systeme UDDI Usage SOAP Processor (Requestor) SOAP Processor (Provider) UDDI Registry WSDL WSDL SOAP 1. Create WSDL describing service 2.

SOAP Web Services Defined WSDL: http://www.sagecomputing.com.au/departments ?wsdl Web Service Depts getName getDetails updateName Operation Operation Operation Internet (Client) HTTP

3.1 Tutorial example implementing web services with plain SOAP, WSDL

Internet Web Application Server UDDI Service Registry/Broker Client PC 1: Send service description WSDL File 2: return service handle UDDI protocol 3: Send SOAP

SOAP – Simple Object Access Protocol WSDL – Web Service Description Language UDDI – Universal Description, Discovery, and Integration...

Based on information in the UDDI registry, the Web services client developer uses instructions in the WSDL to construct SOAP messages for exchanging data with