Top Banner
05/11/22 1 Introduction to Web Services Bina Ramamurthy [email protected] This work is partially supported by NSF-DUE-CCLI-A&I Grant 0311473
27
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ppt

04/10/23 1

Introduction to Web Services

Bina [email protected] work is partially supported by NSF-DUE-CCLI-A&I Grant 0311473

Page 2: ppt

04/10/23 2

Topics for Discussion

Webservices and Service Oriented Architectures (SOA)XML (eXtensible Markup Language)SOAP (Simple Object Access Protocol)WS (Web Services)Summary

Page 3: ppt

04/10/23 3

Web Services and SOA

Web Services is a technology that allows for applications to communicate with each other in a standard format.A Web Service exposes an interface that can be accessed through XML messaging.A Web service uses XML based protocol to describe an operation or the data exchange with another web service. Ex: SOAPA group of web services collaborating accomplish the tasks of an application. The architecture of such an application is called Service-Oriented Architecture (SOA).

Page 4: ppt

04/10/23 4

SOA in Real World: Report in InfoWorld, May 2, 2005 Issue 18

http://www.infoworld.com/article/05/05/02/18FEsoabt_1.html?WEB%20SERVICES

State of Massachusetts uses SOA to deliver healthcare services. With HTML web application it had no control of look and feel and handling many hospitals. With SOAP based messaging they can easily handle different systems, billing systems, medical records systems etc. Use Microsoft-based systems.Countrywide financial simplifies lending: IBM Websphere based SOA is used to deliver services.Guardian Life Insurance uses SOA: IBM websphere based services. Uses EJB for business logic.British Telecom uses combination of BEA systems and Microsoft’s Connected Services Framework. Billing backend and operational support for the organization are web services. Legacy systems are enabled as web services.Amazon.com provides WS API for developers to implement applications leveraging their architecture and data.

Page 5: ppt

04/10/23 5

XML

XML is a markup language, developed by W3C (World Wide Web Consortium), mainly to overcome the limitations of HTML.But it took a life of its own and has become a very popular part of distributed systems.We will examine its definition, associated specifications (DTD, XSLT etc.), Java APIs available to process XML, protocols and services based on XML, and the role XML plays in a distributed computing environment.

Page 6: ppt

04/10/23 6

XML Processing Models

XML Input ProcessingBusiness Logic HandlingXML Output Processing

BusinessLogic

EXTRACT WEBXML input XML output

Page 7: ppt

04/10/23 7

XML input Processing

1. Processing and validating the source document

2. Recognizing/searching for relevant information based on its location or its tagging in the source document

3. Extracting relevant information once it has been located

4. Mapping/binding retrieved information to business objects

Page 8: ppt

04/10/23 8

XML Processing Technologies

SAX, Simple API for XMLDOM, Document Object Model API from W3CXSLT, XML Style Sheets Language Transformations from W3CXPath, the XML Path Language from W3COther third party APIs.

Page 9: ppt

04/10/23 9

Apache Ant ToolAnt tool is an XML based build tool.Ant requires its config files to be specified in XML format.Config file build.xml has general commands for ant tool.Ant tool is used for build, deploy, and run java applications.See these tutorial for more information on ant:

Tutorial1: http://www.ii.uni.wroc.pl/~nthx/java/ant.htmlTutorial2:http://www.iseran.com/Java/ant/tutorial/ant_tutorial.htmlAnt Book Chapter:http://www.oreilly.com/catalog/anttdg/chapter/ch01.pdf

Page 10: ppt

04/10/23 10

XML to SOAP

Simple xml can facilitate sending message to receive information.The message could be operations to be performed on objects.Simple Object Access Protocol (SOAP)

Page 11: ppt

04/10/23 11

SOAP Request<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetails xmlns="http://warehouse.example.com/ws"> <productId>827635</productId> </getProductDetails> </soap:Body> </soap:Envelope>

Page 12: ppt

04/10/23 12

SOAP Reply<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetailsResponse xmlns="http://warehouse.example.com/ws"> <getProductDetailsResult> <productName>Toptimate 3-Piece Set</productName> <productId>827635</productId> <description>3-Piece luggage set. Black Polyester.</description> <price>96.50</price> <inStock>true</inStock> </getProductDetailsResult> </getProductDetailsResponse> </soap:Body> </soap:Envelope>

Page 13: ppt

04/10/23 13

SOAPWeb Services (WS)Literature surveyed:

1. IBM’s alphaworks site:http://www-106.ibm.com/developerworks/webservices/2.

http://www-3.ibm.com/software/solutions/webservices/pdf/WSCA.pdf

3. O’Reilly book on Web Services: Kim Topley’s Webservices in a Nutshell: http://www.oreilly.com/catalog/javawsian/index.html

This link has a sample chapter (SAAJ) and zip of all examples in the book.

4. http://www.w3.org/DesignIssues/WebServices.html

Page 14: ppt

04/10/23 14

Web Services Suite of Protocols

A suite of protocols define the Web Services Technology.These are used to describe, publish, discover, deliver and interact with services.The information about the protocols is from IBM’s developerworks.

Page 15: ppt

04/10/23 15

WS Suite of ProtocolsMessaging protocol Simple Object Access Protocol (SOAP) encodes messages so that they can be delivered over the transport protocols HTTP, SMTP or IIOP.Web Services Definition Language (WSDL) is used to specify the service details such as name, methods and their parameters, and the location of the service. This facilitates the registering and discovery of the service.For services to locate each other, the Universal Description, Discovery and Integration (UDDI) protocol defines a registry and associated protocols for locating and accessing services.

Page 16: ppt

04/10/23 16

WS Suite of Protocols (contd.)

The WS-Transaction and WS-Coordination protocols work together to handle distributed transactions.The Business Process Execution Language for Web Services (BPEL4WS) defines workflow operations. WS-Security is a family of protocols that cover authentication, authorization, federated security, secure communications, and delivery. WS-Policy is another group of protocols that define the policy rules behind how and when Web services can interact with each other. WS-Trust defines how trust models work between different services.

Page 17: ppt

04/10/23 17

WS Stack

Network

XML-based Messaging

Service Description

Service Publication

Service Discovery

Service Flow

HTTP, FTP, MQEmail, IIOP

SOAP

WSDL

UDDI

UDDI

WSFL

Secu

rity

Man

ag

em

en

t

Qu

ality

of S

erv

ice

Page 18: ppt

04/10/23 18

WS Interoperability Infrastructure

Network

XML Messaging

Service DescriptionWSDL

SOAP

HTTP

Do you see any platform or language dependencies here?

Page 19: ppt

04/10/23 19

JAX-RPC

JAX-RPC: Java API for XML-based Remote Procedure Call (RPC).An API for building Web Services and Web Services clients.Some important concepts in JAX-RPC are:

Type-mapping system (WSDL to Java) Service endpoint Exception handling Service endpoint context Message handlers Service clients and service context SOAP with attachments Runtime services JAX-RPC client invocation models

Page 20: ppt

04/10/23 20

JAX-RPC (contd.)JAX-RPC is designed to provide a simple way for developers to create Web services server and Web services client.Based on remote procedure calls; so the programming model is familiar to Java developers who have used RMI or CORBA.Major difference between RMI and JAX-RPC is that messages exchanged are encoded in XML based protocol and can be carried over a variety of transport protocols such as HTTP, SMTP etc.You can use JAX-RPC without having to be an expert in XML, SOAP, or HTTP.

Page 21: ppt

04/10/23 21

The JAX-RPC Programming Model

Services, ports and bindingsJAX-RPC web service servers and clientsJAX-RPC service creationJAX-RPC client and server programming environmentsStubs and tiesClient invocation modesStatic and dynamic stubs and invocation

Page 22: ppt

04/10/23 22

Services, ports and bindings

Service endpoint interface or service endpoint that defines one or more operations that the web service offers.Access to an endpoint is provided by binding it to a protocol stack through a port. A port has an address that the client can use to

communicate with the service and invoke its operations.

An endpoint can be bound to different ports each offering a different suite of protocols for interaction.

Page 23: ppt

04/10/23 23

Endpoint, Port and binding

SOAP1.1Over http

SOAP 1.1 overhttps

Other. Ex:ebXML overSMTP

Port1 port2 port3

endpoint

Web services Client

Web service

https 1.1 transportsoap1.1 messages

Page 24: ppt

04/10/23 24

WS Development Lifecycle

Build: Definition of service interface Definition of service implementation

New services Existing application into WS Composing a WS out of other WS and applications

Source compiled and Stubs and Ties are generated.

Deploy: Publication of the service interface and service

implementation to service registry or service requestor.

Deployment of executables in an execution environment.

Page 25: ppt

04/10/23 25

WS Development Lifecycle (contd.)

Run: A WS is available for invocation. Requestor can perform find and bind operation.Manage: on going management and administration for security, availability, performance, QoS, and business processes.

Page 26: ppt

04/10/23 26

Service Oriented Architectures

Lets look at some success stories.Amazon.com has is data collection available web services developers.See these URLs:Amazon.com E-Commerce Service (ECS)

Conceptual Model       ECS Usage/Query Scenarios            Types of data available through ECS (and not

available) Sample applications (some of them are cool) Programming and API for making (SOAP) requests

Page 27: ppt

04/10/23 27

Summary

We looked at foundational concepts supporting web services: XML, SOAP, WSDL and Web Services standards.We also illustrated the concepts using sample programs.Best way to get started is try out WS tutorials by yourself.