Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol...
Transcript of Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol...
![Page 1: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/1.jpg)
Web Based Applications
![Page 2: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/2.jpg)
Basic Building Blocks
• HTTP/HTTPS • XML
– EXtensible Markup Language – Designed to carry data – User-defined tags
<?xml version="1.0" encoding="ISO-8859-1"?> <note id="501" >
<to>ABC</to> <from>XYZ</from> <heading>Reminder</heading>
<body>Call 123</body>
</note>
![Page 3: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/3.jpg)
XML Namespace <root> <h:table xmlns:h="http://www.w3.org/TR/html4/"> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> <f:table xmlns:f="http://www.w3schools.com/furniture"> <f:name>African Coffee Table</f:name> <f:width>80</f:width> <f:length>120</f:length> </f:table> </root>
![Page 4: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/4.jpg)
XML Schema <?xml version="1.0"?> <note xmlns=“http://www.w3schools.com” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation="http://www.w3schools.com note.xsd"> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
![Page 5: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/5.jpg)
XML Schema <?xml version="1.0"?> <xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema” targetNamespace=“http://www.w3schools.com” xmlns=“http://www.w3schools.com” elementFormDefault="qualified"> <xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> ….. </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
![Page 6: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/6.jpg)
Web Services • Defined as “a software
system designed to support interoperable Machine to Machine interaction over a network “
• Components are – SOAP – WSDL – UDDI
![Page 7: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/7.jpg)
SOAP • Simple Object Access Protocol • A protocol for exchanging XML-based
messages over computer networks • Works on top of HTTP/HTTPS • Advantage
– Work over http proxies • Disadvantage
– Slower
![Page 8: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/8.jpg)
SOAP Message
A SOAP message contains: – Envelope element – Header element (optional) – Body element – Fault element (optional)
![Page 9: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/9.jpg)
SOAP Message Example
<?xml version="1.0"?> <soap:Envelope xmlns:soap=http://www.w3.org/2001/12/soap-envelope soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:header> ... ... </soap:header> <soap:Body> ... ... <soap:fault> ... ... </soap:fault> </soap:Body> </soap:Envelope>
![Page 10: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/10.jpg)
Request <?xml version="1.0"?> <soap:Envelope xmlns:soap=“http://www.w3.org/2001/12/soap-envelope” soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPrice xmlns:m="http://www.w3schools.com/prices"> <m:Item>Apples</m:Item> </m:GetPrice> </soap:Body> </soap:Envelope>
![Page 11: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/11.jpg)
Response
<?xml version="1.0"?> <soap:Envelope xmlns:soap=“http://www.w3.org/2001/12/soap-envelope” soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Body> <m:GetPriceResponse xmlns:m="http://www.w3schools.com/prices"> <m:Price>1.90</m:Price> </m:GetPriceResponse> </soap:Body> </soap:Envelope>
![Page 12: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/12.jpg)
WSDL
• Web Service Description Language • Provides a model for describing Web
Services • Defines services as collections of network
endpoints, or ports • Client program parses the WSDL
description of the services offered by the server
![Page 13: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/13.jpg)
Document Structure <definitions> <types>…………definition of types........……</types> <message>.……definition of a message......</message> <portType>.……definition of a port...............</portType> <binding>………definition of a binding……..</binding> </definitions>
![Page 14: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/14.jpg)
WSDL Example <message name="getTermRequest"> <part name="term" type="xs:string"/> </message> <message name="getTermResponse"> <part name="value" type="xs:string"/> </message> <portType name="glossaryTerms"> <operation name="getTerm"> <input message="getTermRequest"/> <output message="getTermResponse"/> </operation> </portType>
![Page 15: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/15.jpg)
Example contd. <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 16: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/16.jpg)
UDDI • Universal Description, Discovery and Integration • A platform-independent, XML-based registry for
businesses worldwide to list themselves on the Internet • Open industry initiative, sponsored by OASIS • Consists of the following components
– White Pages • Information about WS providers
– Yellow Pages • Available Web services
– Green Pages • Technical interfaces for to access and manage WS
![Page 17: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/17.jpg)
Models of Web Services
• RPC • Message Oriented • Service Oriented • Resource Oriented • Policy Based
![Page 18: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/18.jpg)
BPEL4WS
• Used for defining a new Web service by composing a set of existing services
• Primitive activities – Invoke, Receive, Reply, Wait, Assign, Throw,
Terminate. • Structure activities
– Sequence, Switch, While, Pick, Flow • Partners
![Page 19: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/19.jpg)
Example
![Page 20: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/20.jpg)
Semantic Web • Goal is to express the web content in such a
format, which can be read and used by software • Uses the following standards
– XML – XML Schema – RDF – RDF Schema – OWL – SPARQL
![Page 21: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/21.jpg)
Semantic Web Contd.
• RDF – a general method of modeling information,
through a variety of syntax formats – Expresses knowledge about resources in the
form of subject-predicate-object expressions – Resource is named by Uniform Resource
Identifier (URI).
![Page 22: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/22.jpg)
Semantic Web contd.
• XML Schema – expresses a schema: a set of rules to which an
XML document must conform in order to be considered 'valid' according to that schema
• RDF Schema – Knowledge representation language – Describes predominantly in terms class,
subclass, domain and range
![Page 23: Web Based Applicationspallab/web-services/Web-Service.pdf · SOAP • Simple Object Access Protocol • A protocol for exchanging XML -based messages over computer networks • Works](https://reader033.fdocuments.us/reader033/viewer/2022051606/601d7906fe5c62455e6ee2ff/html5/thumbnails/23.jpg)
Semantic Web contd.
• OWL – Web Ontology Language – adds more vocabulary for describing properties
and classes than RDF Schema • SPARQL
– protocol and query language for semantic web data sources