1/30/20161 Introduction to Web Services Bina Ramamurthy

Preview:

DESCRIPTION

HTTP Protocol for communication among web entities. It is a standard from IETF (Internet Engineering Task Force) and W3C: (World Wide Web Consortium) Request-response model for client-server systems HTTP operates by sending requests with operations to be performed on resources referred by Uniform Resource Identifiers (URI) Request methods are: HEAD, GET, POST, PUT, DELETE, TRACE,… PATCH (just a few standard commands) 1/30/20163

Citation preview

05/03/23 1

Introduction to Web ServicesBina Ramamurthybina@cse.buffalo.edu

05/03/23 2

Topics for DiscussionHTTP : Hyper Text Transfer ProtocolHTML: Hyper Text Markup LanguageXML: eXtensible Markup LanguageResource references on the webWeb servicesSOAP: Simple Object Request ProtocolREST: Representational State TransferSummary

HTTPProtocol for communication among web entities.It is a standard from IETF (Internet Engineering Task Force) and W3C: (World Wide Web Consortium)Request-response model for client-server systems HTTP operates by sending requests with operations to be performed on resources referred by Uniform Resource Identifiers (URI)Request methods are: HEAD, GET, POST, PUT, DELETE, TRACE,… PATCH (just a few standard commands)

05/03/23 3

HTMLHyper text mark-up languageStandard markups for structural organization of web pagesExample:<tr> <td style="vertical-align: top;"><br> </td> <td style="vertical-align: top;">File System<br> </td> <td style="vertical-align: top;"><a href="FileSystemOct21.ppt">FileSys</a><br> </td> <td style="vertical-align: top;"><br> </td> </tr>

05/03/23 4

HTML over HTTP

05/03/23 5

Web BrowserWeb serverhttp://www.cse.buffalo.edu/faculty/bina

Web Browser

Web Browser

Request:Get http:…

Response:index.html

browser interpretation ofindex.html

05/03/23 6

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

05/03/23 7

First Look at XMLIt has no predefined tags. Such as in HTML Domains may specify their own set of

standard tagsIt is stricter. Most html document have errors and the

browser have to built to take care of these. On the other hand XML has a strict syntax. There is a notion of validity and A notion of well-formed.

05/03/23 8

An Example: MemoSee the two documents enclosed: one in html and the other in XML formats.Observe the meaningful tags in XML.Compare it to a class definition: it looks like a class with data definitions and accessors (tags).

05/03/23 9

Memo.html vs memo.xml<!DOCTYPE html PUBLIC "-//W3C//DTD

HTML 4.01 Transitional//EN"><html><head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-

1"> <title>memo.html</title></head><body><h3>Hello World</h3>Bina<br>CSE486 DS Students <br>Wake up everyone<br>

BR<br><br></body></html>

<?xml version="1.0" ?>   <!DOCTYPE memo (View Source for

full doctype...)> - <memo>  <header>Hello World</header>   <from>bina</from>   <to>CSE486 DS Students</to>   <body>Wake up everyone</body>   <sign>br</sign>   </memo>

XML

05/03/23 10

XML parsingLets understand XML parsing.Reference: http://java.sun.com/developer/technicalArticles/xml/mapping/index.htmlMapping/parsing is similar to compiling: if it is not valid or well formed, the parser is going to complainLets look at some examples starting from the very beginning.

05/03/23 11

05/03/23 12

XML to SOAPSimple xml can facilitate sending message to receive information.The message could be operations to be performed on objects.Simple Object Access Protocol (SOAP)Representational State Transfer (REST) is an architectural pattern on HTTP’s methods

05/03/23 13

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>

05/03/23 14

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>

05/03/23 15

SOAPWeb Services (WS)SOARead this paper:http://www.w3.org/DesignIssues/

WebServices.html

05/03/23 16

WS Stack

Network

XML-based Messaging

Service Description

Service Publication

Service Discovery

Service Flow

HTTP, FTP, MQEmail, IIOP

SOAP

WSDL

UDDI

UDDI

WSFL

SecurityM

anagement

Quality of Service

05/03/23 17

WS Interoperability Infrastructure

Network

XML Messaging

Service DescriptionWSDL

SOAP

HTTP

Do you see any platform or language dependencies here?

05/03/23 18

SummaryWe looked at foundational concepts supporting web services: XML, SOAP, WSDL and Web Services standards.We also illustrated the concepts using sample programs.We will discuss REST-based web services and WDSL in the next lectures.

Recommended