web service- guest lecture at national wokshop
DESCRIPTION
TRANSCRIPT
Web Services
Nishikant Taksande
Guest lecture during National Wok shop at IASRI, New Delhi, India
Agenda
Web service interactions ArchitectureExecution modelUse of web servicesIntroductionWorking of web servicesDemonstration
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."
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.
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
Web services at a glance
Developer
Service request
Service response
RemoteServer
Web Service
Web service interaction
Publish operation
Find operation
Bind operation
Service registry
Service requester
Service provider
Interaction
Architectural role
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)
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.
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>
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
SOAP…
SOAP is language independent
SOAP is simple and extensible
SOAP is based on XML
SOAP allows you to get around firewalls
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>
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.
UDDI…
UDDI is an open industry initiative enabling businesses to discover each other and define how they interact over the Internet
Architecture
Service requester
BrokerUDDI
Service provider
WSDL
WSDL
SOAP
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
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
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
Demonstration
Creating web services
Consuming web services in web applications
Consuming web services in windows applications