Web Based Applications Basic Building Blocks • HTTP/HTTPS • XML – EXtensible Markup Language – Designed to carry data – User-defined tags encoding="ISO-8859-1"?> ABC XYZ Reminder Call 123

Download Report

Transcript Web Based Applications Basic Building Blocks • HTTP/HTTPS • XML – EXtensible Markup Language – Designed to carry data – User-defined tags encoding="ISO-8859-1"?> ABC XYZ Reminder Call 123

Web Based Applications
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>
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>
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>
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>
Web Services
• Defined as “a software
system designed to
support interoperable
Machine to Machine
interaction over a
network “
• Components are
– SOAP
– WSDL
– UDDI
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
SOAP Message
A SOAP message contains:
–
–
–
–
Envelope element
Header element (optional)
Body element
Fault element (optional)
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>
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>
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>
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
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>
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>
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>
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
Models of Web Services
•
•
•
•
•
RPC
Message Oriented
Service Oriented
Resource Oriented
Policy Based
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
Example
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
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).
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
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