Web Services: Understanding XML, WSDL, and Java APIs, Lecture notes of Web Application Development

An introduction to web services, focusing on XML, WSDL, and Java APIs for their implementation. Web services are applications available via the Web, primarily for application-to-application communication. XML is used to define data structures and ensure semantic interoperability. WSDL is an XML document used to describe web services, including their operations and messages. Java APIs such as JAXP, JAX-RPC, JAXM, and JAXR facilitate the development and interaction with web services.

Typology: Lecture notes

2019/2020

Uploaded on 11/06/2020

shibu-n
shibu-n 🇮🇳

2 documents

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Web Services
Web Services
Based partially on Sun Java Tutorial at
Based partially on Sun Java Tutorial at
http://java.sun.com/webservices/
http://java.sun.com/webservices/
Also, XML, Java and the Future of The
Also, XML, Java and the Future of The
Web, Jon Bosak.
Web, Jon Bosak.
And WSDL Tutorial at:
And WSDL Tutorial at:
http://www.w3schools.com/wsdl/
http://www.w3schools.com/wsdl/
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Web Services: Understanding XML, WSDL, and Java APIs and more Lecture notes Web Application Development in PDF only on Docsity!

Web Services

Web Services

Based partially on Sun Java Tutorial at

Based partially on Sun Java Tutorial at

http://java.sun.com/webservices/

http://java.sun.com/webservices/

Also, XML, Java and the Future of The

Also, XML, Java and the Future of The

Web, Jon Bosak.

Web, Jon Bosak.

And WSDL Tutorial at:

And WSDL Tutorial at:

http://www.w3schools.com/wsdl/

http://www.w3schools.com/wsdl/

Netprog 2002 - HTTP

World-Wide Web

World-Wide Web

(Tim Berners-Lee & Cailliau ’92)

(Tim Berners-Lee & Cailliau ’92)

Netprog 2002 - HTTP

What are Web Services?

What are Web Services?

Services available via the Web.

Services available via the Web.

Meant mainly for application to application

Meant mainly for application to application

communication (as opposed to users directly)

communication (as opposed to users directly)

Enables Business-to-Business transactions.

Enables Business-to-Business transactions.

Toward a “Semantic Web”.

Toward a “Semantic Web”.

E.g., a web service is contacted on a URL

E.g., a web service is contacted on a URL

using the SOAP protocol over HTTP.

using the SOAP protocol over HTTP.

Netprog 2002 - HTTP

Web Service Examples

Web Service Examples

A stock quote service.

A stock quote service.

An application requires the current value of a

An application requires the current value of a

stock, the web service returns it.

stock, the web service returns it.

A route finder for delivery of goods.

A route finder for delivery of goods.

Given an initial and a final location, find the most

Given an initial and a final location, find the most

cost-effective delivery route.

cost-effective delivery route.

A weather service, a map service, a web

A weather service, a map service, a web

search service…

search service…

any composition of Web services.

any composition of Web services.

Netprog 2002 - HTTP

What is XML?

What is XML?

Extensible Markup Language.

Extensible Markup Language.

HTML++, SGML--.

HTML++, SGML--.

Document Type Definitions (DTD) precisely

Document Type Definitions (DTD) precisely

define valid tags and their grammar.

define valid tags and their grammar.

Not backward compatible with HTML.

Not backward compatible with HTML.

System-independent and vendor-

System-independent and vendor-

independent.

independent.

Product of the World Wide Web Consortium

Product of the World Wide Web Consortium

(W3C), trademarked by MIT.

(W3C), trademarked by MIT.

Netprog 2002 - HTTP

XML Sample

XML Sample

Why I am Overworked

Why I am Overworked

Fred

Fred

Smith

Smith

Jones and Associates

Jones and Associates

This is the abstract

This is the abstract

Netprog 2002 - HTTP

What Makes XML Portable?

What Makes XML Portable?

The schema (DTD) is associated with a

The schema (DTD) is associated with a

document which allows to perform

document which allows to perform

validation on the document.

validation on the document.

Human-readable/writable.

Human-readable/writable.

Independent of presentation

Independent of presentation

(formatting).

(formatting).

Netprog 2002 - HTTP

Syntactic vs Semantic

Syntactic vs Semantic

Interoperability

Interoperability

While XML is portable, communicating

While XML is portable, communicating

parties still need to agree on:

parties still need to agree on:

Document type definitions

Document type definitions

Meaning of tags

Meaning of tags

Operations” on data (interfaces).

Operations” on data (interfaces).

Meaning of those operations.

Meaning of those operations.

Semantic interoperability is still a

Semantic interoperability is still a

problem!

problem!

Netprog 2002 - HTTP

WSDL Major Elements

WSDL Major Elements

Element

Element Defines

Defines

The operations performed by

The operations performed by

the web service

the web service

The messages used by the

The messages used by the

web service

web service

The data types used by the

The data types used by the

web service

web service

The communication protocols

The communication protocols

used by the web service

used by the web service

Netprog 2002 - HTTP

WSDL Structure

WSDL Structure

definition of types...

definition of types...

definition of a message.

definition of a message.

definition of a port...

definition of a port...

definition of a binding

definition of a binding

Netprog 2002 - HTTP

WSDL Ports

WSDL Ports

The

The

element is the most

element is the most

important WSDL element.

important WSDL element.

It defines a web service, the operations

It defines a web service, the operations

that can be performed, and the

that can be performed, and the

messages that are involved.

messages that are involved.

The

The

element can be

element can be

compared to a function library (or a

compared to a function library (or a

module, or a class) in a traditional

module, or a class) in a traditional

programming language.

programming language.

Netprog 2002 - HTTP

WSDL Messages

WSDL Messages

The

The

element defines

element defines

the data elements of an operation.

the data elements of an operation.

Each messages can consist of one

Each messages can consist of one

or more parts. The parts can be

or more parts. The parts can be

compared to the parameters of a

compared to the parameters of a

function call in a traditional

function call in a traditional

programming language.

programming language.

Netprog 2002 - HTTP

WSDL Bindings

WSDL Bindings

The

The

element defines

element defines

the message format and protocol

the message format and protocol

details for each port.

details for each port.

Netprog 2002 - HTTP

WSDL Operation Types

WSDL Operation Types

Type

Type Definition

Definition

One-way

One-way The operation can receive a message but

The operation can receive a message but

will not return a response

will not return a response

Request-response

Request-response The operation can receive a request and will

The operation can receive a request and will

return a response

return a response

Solicit-response

Solicit-response The operation can send a request and will

The operation can send a request and will

wait for a response

wait for a response

Notification

Notification The operation can send a message but will

The operation can send a message but will

not wait for a response

not wait for a response