Web Services Middleware Ivan Hernndez University of Toronto - - PowerPoint PPT Presentation

web services middleware
SMART_READER_LITE
LIVE PREVIEW

Web Services Middleware Ivan Hernndez University of Toronto - - PowerPoint PPT Presentation

Web Services Middleware Ivan Hernndez University of Toronto ECE1770, Spring 2007 university-logo Ivan Hernndez (UofT) Web Services January 22, 2007 1 / 33 Web Services Definition A Web service is a software system designed to support


slide-1
SLIDE 1

university-logo

Web Services Middleware

Ivan Hernández

University of Toronto

ECE1770, Spring 2007

Ivan Hernández (UofT) Web Services January 22, 2007 1 / 33

slide-2
SLIDE 2

university-logo

Web Services

Definition

A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. Interoperate using XML-based standars Self-contained and self-describing XML + HTTP Platform, object model, and programming language independent Basic standards SOAP , WSDL, and UDDI

Ivan Hernández (UofT) Web Services January 22, 2007 2 / 33

slide-3
SLIDE 3

university-logo

SOAP

SOAP 1.2 is a W3C standard for exchanging XML-based messages over a computer network. It defines a message structure Message exchange using a variety of underlying protocols It defines the rules for processing a SOAP message SOAP defines message exchange patterns Why SOAP anyway? Simple Object Access Protocol Simple Object Access Protocol Simple Object Access Protocol Simple Object Access Protocol

Ivan Hernández (UofT) Web Services January 22, 2007 3 / 33

slide-4
SLIDE 4

university-logo

Skeleton SOAP Message

<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Header> ... </soap:Header> <soap:Body> ... <soap:Fault> ... </soap:Fault> </soap:Body> </soap:Envelope>

Ivan Hernández (UofT) Web Services January 22, 2007 5 / 33

slide-5
SLIDE 5

university-logo

SOAP Examples

SOAP Request

<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPrice xmlns:m="http://www.foo.org/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> </soap:Envelope>

SOAP Reply

<soap:Body> <m:GetPriceResponse xmlns:m="http://www.foo.com/prices"> <m:Price> 2 </m:Price> </m:GetPriceResponse> </soap:Body>

Ivan Hernández (UofT) Web Services January 22, 2007 7 / 33

slide-6
SLIDE 6

university-logo

WSDL

Web Service Description Language using an XML document It specifies the location of the service It specifies the methods that the service exposes WSDL 2.0 about to become a W3C recomendation

Ivan Hernández (UofT) Web Services January 22, 2007 8 / 33

slide-7
SLIDE 7

university-logo

WSDL basic structure

<definitions> <types> Definition of types used, XMLSchema </types> <message> Definition of parts of each message and the data elements </message> <portType> Definition the operations performed and involved messages </portType> <binding> Communication protocol used </binding> </definitions>

Ivan Hernández (UofT) Web Services January 22, 2007 10 / 33

slide-8
SLIDE 8

university-logo

WSDL Example

<message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType>

Ivan Hernández (UofT) Web Services January 22, 2007 12 / 33

slide-9
SLIDE 9

university-logo

WSDL Example (cont.)

<binding type="glossaryTerms" name="b1"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <operation> <soap:operation soapAction="http://example.com/getTerm"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding>

Ivan Hernández (UofT) Web Services January 22, 2007 14 / 33

slide-10
SLIDE 10

university-logo

UDDI

Universal Discovery, Description, and Integration Service providers use UDDI to advertise the services they offer. Service Requesters use UDDI to discover services that suit their requirements

Ivan Hernández (UofT) Web Services January 22, 2007 15 / 33

slide-11
SLIDE 11

university-logo

Putting It All Together

UDDI advertise the services by providing WSDLs WSDL specifies location and methods of the service SOAP defines the messages format and processing Extensible standards to define, publish and use Web Services.

Ivan Hernández (UofT) Web Services January 22, 2007 16 / 33

slide-12
SLIDE 12

university-logo

How are WS related to middleware?

Definition

Middleware systems are comprised of abstractions and services to facilitate the design, development, integration and deployment of distributed applications in heterogeneous networking environments. This is exactly what Web Service are about! XML + HTTP provide a uniform and widely accessible interface!

Ivan Hernández (UofT) Web Services January 22, 2007 17 / 33

slide-13
SLIDE 13

university-logo

Axis2

Apache’s core engine for Web services Fast, low memory footprint, flexibility, stability, ..., and extensible Core engine

Ivan Hernández (UofT) Web Services January 22, 2007 18 / 33

slide-14
SLIDE 14

university-logo

This is nice, but . . .

What about reliability, transactions, security, policies ... ? SOAP does not define any of these :( But it is extensible! :)

Ivan Hernández (UofT) Web Services January 22, 2007 19 / 33

slide-15
SLIDE 15

university-logo

And more Web Service Plataform!

WS-Notification Standardise the way WS interact using Notifications or Events. Event Driven Architectures using WS Pubscribe WS-Coordination Coordinate the actions of distributed

  • apps. It enables transaction process-

ing, workflow, and other systems for coordination Kandula WS-BPEL Business Process Execution Lan-

  • guage. Compose WS functionality in

the right order Twister WS-Security Message integrity, confidentiality, and single message authentication WSS4J WS-Policy To express a set of requirements that have to be met in order to consume a web service WS-Commons

Using all these together we can do anything that an Enterprise Midleware does!

Ivan Hernández (UofT) Web Services January 22, 2007 20 / 33

slide-16
SLIDE 16

university-logo

WS-ReliableMessaging

Many errors may interrupt a conversation. Messages may be lost, duplicated or reordered and lost of volatile state. WS-RM is a protocol to deliver messages reliably in the presence

  • f software component, system, or network failures

The protocol allows to identify, track, and manage the reliable delivery of messages Transport-independent and extensible Delivery assurances: AtMostOnce, AtLeastOnce, ExactlyOnce, and InOrder.

Ivan Hernández (UofT) Web Services January 22, 2007 21 / 33

slide-17
SLIDE 17

university-logo

WS-RM: Model and example

Ivan Hernández (UofT) Web Services January 22, 2007 22 / 33

slide-18
SLIDE 18

university-logo

WS-RM: Model and example

Ivan Hernández (UofT) Web Services January 22, 2007 23 / 33

slide-19
SLIDE 19

university-logo

WS-RM: Sandesha2

Sandesha2 is an implementation for the server and client side To use on the server side, just add the module to the Axis2 handler stack In the client side . . .

Ivan Hernández (UofT) Web Services January 22, 2007 25 / 33

slide-20
SLIDE 20

university-logo

WS-RM: Sandesha2, client side

ServiceClient client =new ServiceClient(configContext,null); // set client options options client.engageModule(new QName ("sandesha2")); Callback cb1 = new TestCallback ("Callback 1"); client.sendReceiveNonBlocking ( getEchoOMBlock("echo1","sequence1"),cb1); Callback cb2 = new TestCallback ("Callback 2"); client.sendReceiveNonBlocking( getEchoOMBlock("echo2","sequence1"),cb2); clientOptions.setProperty( SandeshaClientConstants.LAST_MESSAGE, "true"); Callback cb3 = new TestCallback ("Callback 3"); client.sendReceiveNonBlocking( getEchoOMBlock("echo3","sequence1"),cb3);

Ivan Hernández (UofT) Web Services January 22, 2007 27 / 33

slide-21
SLIDE 21

university-logo

Questions?

Ivan Hernández (UofT) Web Services January 22, 2007 28 / 33

slide-22
SLIDE 22

university-logo

Discussion

Additional text-processing and bandwidth introduced by XML

◮ CPU to serialize/de-serialize, message and transport encription,

XML-tags for all elements, . . .

◮ Problem solved by technology? ◮ Are there XML alternatives? ◮ Web Services Invocation Framework. Takes advantage of WSDL

’s capability to offer multiple bindings for the same service

◮ Trade between performance and highly flexible protocols Ivan Hernández (UofT) Web Services January 22, 2007 29 / 33

slide-23
SLIDE 23

university-logo

Discussion (2)

Middleware’s success and proliferation has recreated, at a higher level, the very problem it was designed to address. Web services provide middleware for middleware WS-Security (message level security), WS-Reliable Messaging, WS-Addressing only works for SOAP , not at abstract WSDL level Web based services vs Web services, which is better?

◮ Each one to solve different problems :) Ivan Hernández (UofT) Web Services January 22, 2007 30 / 33

slide-24
SLIDE 24

university-logo

Discussion (3)

With RMI or CORBA, you get the functionality of a remote class just as you would a local class, but with WS . . .

◮ You cannot enforce business logic on the client ◮ You cannot access read-only properties objects ◮ You cannot serialize datatypes such as HashTable ◮ You cannot enforce logic in property getters or setters on objects

All these differences are because . . . It is all about XML messages rather than objects and methods!

Ivan Hernández (UofT) Web Services January 22, 2007 31 / 33

slide-25
SLIDE 25

university-logo

Discussion (4)

Open Source implementation (Apache) vs propietary solution (IBM)

Ivan Hernández (UofT) Web Services January 22, 2007 32 / 33

slide-26
SLIDE 26

university-logo

References

Sun SOA, http://java.sun.com/developer/technicalArticles/WebServices/soa/ Web service Architecture, http://www.w3.org/TR/2004/NOTE-ws-arch-20040211/ Web Services Introduction http://www.w3schools.com/webservices/ws_intro.asp SOAP Tutorial http://www.w3schools.com/soap/ WSDL, http://www.w3.org/TR/wsdl UDDI.org http://www.uddi.org Apache Web Services, http://ws.apache.org/ WS-Reliable Messaging spec, ftp://www6.software.ibm.com/software/developer/library/ws-reliablemessaging200502.pdf WS-IF , http://www-128.ibm.com/developerworks/library/ws-wsif.html WS-Notification, http://www.ibm.com/developerworks/library/specification/ws-notification/ WS-Coordination, http://www.ibm.com/developerworks/library/ws-coor/ WS-BPEL, http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wsbpel WS-Security, http://www.oasis-open.org/committees/wss/ WS-Policy, http://www.ibm.com/developerworks/library/ws-polfram/ Ivan Hernández (UofT) Web Services January 22, 2007 33 / 33