web service- guest lecture at national wokshop

20
Web Services Nishikant Taksande Guest lecture during National Wok shop at IASRI, New Delhi, India

Upload: nishikant-taksande

Post on 29-Nov-2014

2.432 views

Category:

Spiritual


3 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Web service- Guest Lecture at National Wokshop

Web Services

Nishikant Taksande

Guest lecture during National Wok shop at IASRI, New Delhi, India

Page 2: Web service- Guest Lecture at National Wokshop

Agenda

Web service interactions ArchitectureExecution modelUse of web servicesIntroductionWorking of web servicesDemonstration

Page 3: Web service- Guest Lecture at National Wokshop

What are web services..?

“A software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically Web Services Description Language WSDL). Other systems interact with the web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards."

Page 4: Web service- Guest Lecture at National Wokshop

Why web service..?

By using Web services, your application can publish its function or message to the rest of the world

Web services use XML to code and to decode data, and SOAP to transport it

With Web services, .NET application on Win 2k server's system can connect with other java application.

Page 5: Web service- Guest Lecture at National Wokshop

What are web services..?Web services are application component

Web services are platform independent

Web services are self-describing

Web services can be discovered using UDDI

Web services can be used by other applications

XML is the basis for Web services

Page 6: Web service- Guest Lecture at National Wokshop

Web services at a glance

Developer

Service request

Service response

RemoteServer

Web Service

Page 7: Web service- Guest Lecture at National Wokshop

Web service interaction

Publish operation

Find operation

Bind operation

Service registry

Service requester

Service provider

Interaction

Architectural role

Page 8: Web service- Guest Lecture at National Wokshop

How does it works..?The basic Web services platform is XML + HTTP.

XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.

WSDL (Web Services Description Language)UDDI (Universal Description, Discovery and Integration)Web Service Platform element SOAP (Simple Object Access Protocol)

Page 9: Web service- Guest Lecture at National Wokshop

WSDLWSDL is written in XML

WSDL is an XML document

WSDL is used to describe Web services

WSDL is also used to locate Web services

It specifies the location of the service and the operations (or methods) the service exposes.

Page 10: Web service- Guest Lecture at National Wokshop

WSDLElement Definition<type> The data types used by the web service

<message> The messages used by the web service

<port type> The operations performed by the web service

<binding> The communication protocols used

<message name="getTermRequest"> <part name="term" type="xs:string"/></message>

<message name="getTermResponse"> <part name="value" type="xs:string"/></message>

The <message> element defines the data elements of an operation.Each message can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language.

<portType name="glossaryTerms"> <operation name="setTerm"> <input name="newTerm" message="newTermValues"/> </operation></portType >

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

Page 11: Web service- Guest Lecture at National Wokshop

SOAPSOAP is a communication protocol

SOAP is a format for sending messages

SOAP is for communication between applications

SOAP communicates via Internet

SOAP is platform independent

Page 12: Web service- Guest Lecture at National Wokshop

SOAP…

SOAP is language independent

SOAP is simple and extensible

SOAP is based on XML

SOAP allows you to get around firewalls

Page 13: Web service- Guest Lecture at National Wokshop

SOAP…Element Definition<envelope> identifies the XML document as a SOAP message

<header> contains header information

<body> call and response information

<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> ... Message information goes here ...</soap:Envelope>

ww.w3.org/2001/12/soap-envelope"soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding><soap:Header> <m:Trans xmlns:m="http://www.w3schools.com/transaction/" soap:mustUnderstand="1">234 </m:Trans></soap:Header>......</soap:Envelope>

<soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope”><soap:Body> <m:GetPrice xmlns:m="http://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice></soap:Body></soap:Envelope>

Page 14: Web service- Guest Lecture at National Wokshop

UDDISpecification for a distributed registry of Web services.

Platform independent, open framework

Uses WSDL to describe interfaces to web services.

UDDI is seen with SOAP and WSDL as one of the three foundation standards of web services.

Page 15: Web service- Guest Lecture at National Wokshop

UDDI…

UDDI is an open industry initiative enabling businesses to discover each other and define how they interact over the Internet

Page 16: Web service- Guest Lecture at National Wokshop

Architecture

Service requester

BrokerUDDI

Service provider

WSDL

WSDL

SOAP

Page 17: Web service- Guest Lecture at National Wokshop

Architecture…

CLIENT

SERVER A

DISCOVERY SERVICE

SERVER B

WEB SERVICE

Web service invocation

Where to find web service

Web service is located in server B

How exactly to invoke

Description is send in WSDL

SOAP request for method

SOAP response

Page 18: Web service- Guest Lecture at National Wokshop

Execution model

dfbbFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFF

PROXY

dfHHHH HHHHH HHHHH HHHHH HHHHH HHHHH HHHHH HHHHH HHHHH HHHHbbLLLL

Browser

HTTP

Web Server with .asmx Pages

HTTP

Web Server with .aspx Pages

EXE XMLPHTTP

XML

Client Server Service

Fig. Web Service Execution Model

Page 19: Web service- Guest Lecture at National Wokshop

Use of web services

Reusable application-components.

Connect existing software.

It is largely irrelevant to the client whether the service is developed with Java or ASP.NET or if it is running on Windows, Linux or any other platform

This allows us to hide the details of how a service is implemented; only URL and data types are required

Page 20: Web service- Guest Lecture at National Wokshop

Demonstration

Creating web services

Consuming web services in web applications

Consuming web services in windows applications