0% found this document useful (0 votes)
47 views17 pages

Unit-1 1a) Benefits of XML

Uploaded by

nandini230804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views17 pages

Unit-1 1a) Benefits of XML

Uploaded by

nandini230804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Unit-1

1a) Benefits of XML

The very nature of XML is that it is a structured document format that represents not only the

information to be exchanged but also the metadata encapsulating its meaning.

A) XML Separates Data from HTML

If you need to display dynamic data in your HTML document, it will take a lot of work to edit the

HTML each time the data changes. With XML, data can be stored in separate XML files. This way

you can concentrate on using HTML for layout and display, and be sure that changes in the

underlying data will not require any changes to the HTML.

With a few lines of JavaScript code, you can read an external XML file and update the data content

of your web page.

B) XML Simplifies Data Sharing

In the real world, computer systems and databases contain data in incompatible formats. XML

data is stored in plain text format. This provides a software- and hardware-independent way of

storing data. This makes it much easier to create data that can be shared by different applications.

C) XML Simplifies Data Transport

One of the most time-consuming challenges for developers is to exchange data between

incompatible systems over the Internet. Exchanging data as XML greatly reduces this complexity,

since the data can be read by different incompatible applications.

D) XML Simplifies Platform Changes

Upgrading to new systems (hardware or software platforms), is always time consuming.

Large amounts of data must be converted and incompatible data is often lost. XML data is stored in

text format. This makes it easier to expand or upgrade to new operating systems, new applications,
or

new browsers, without losing data.

E) XML Makes Your Data More Available

Different applications can access your data, not only in HTML pages, but also from XML

data sources. With XML, your data can be available to all kinds of "reading machines" (Handheld

computers, voice machines, news feeds, etc), and make it more available for blind people, or people

with other disabilities.

F) XML is Used to Create New Internet Languages


A lot of new Internet languages are created with XML.

Here are some examples:

• XHTML

• WSDL for describing available web services

• WAP and WML as markup languages for handheld devices

• RSS languages for news feeds

• RDF and OWL for describing resources and ontology

• SMIL for describing multimedia for the web

2) PRESENTATION TECHNOLOGIES: (or in Assignment)

1) XSL

2) XFORMS

3) XHTML

XSL & XSLT:

XSL stands for EXtensible Stylesheet Language.

What is XSLT?

XSLT stands for XSL Transformations. XSLT is the most important part of XSL. XSLT

transforms an XML document into another XML document. XSLT uses XPath to navigate in

XML documents. XSLT is a W3C Recommendation. We want to transform the following XML

document ("cdcatalog.xml") into XHTML:

<?xml version="1.0" encoding="ISO-8859-1"?>

<catalog>

<cd>

<title>Empire Burlesque</title>

<artist>Bob

Dylan</artist><country>USA</country><company>Columbia</company><price>

10.90</price>

<year>1985</year>

</cd> . . .

</catalog>

Then you create an XSL Style Sheet ("cdcatalog.xsl") with a transformation

template: <?xml version="1.0" encoding="ISO-8859-1"?>


<xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template

match="/"> <html>

<body>

<h2>My CD Collection</h2>

<table border="1">

<tr bgcolor="#9acd32">

<th align="left">Title</th>

<th align="left">Artist</th>

</tr>

<xsl:for-each

select="catalog/cd"> <tr>

<td><xsl:value-of select="title"/></td>

<td><xsl:value-of select="artist"/></td>

</tr> </xsl:for-

each> </table>

</body> </html>

</xsl:template>

</xsl:stylesheet>

XFORMS:
XForms is the next generation of HTML forms. XForms is richer and more flexible

than HTML forms. XForms will be the forms standard in XHTML 2.0. XForms is platform and

device independent. XForms separates data and logic from presentation. XForms uses XML to

define form data. XForms stores and transports data in XML documents. XForms contains

features like calculations and validations of forms. XForms reduces or eliminates the need for

scripting. XForms is a W3C Recommendation. The XForms Model. The XForms model is used to

describe the data

The XForms Model:

The XForms model is used to describe the data. The data model is an instance (a template)

of an XML document. The XForms model defines a data model inside a <model> element:

<model>

<instance>

<person>

<fname/>

<lname/>

</person>

</instance>

<submission id="form1" action="submit.asp" method="get"/>

</model>

Example program:

<xforms>

<model>

<instance>

<person><fname/><lname/></person></instance>

<submission id="form1" action="submit.asp" method="get"/>

</model>

<input ref="fname"><label>First Name</label></input><input

ref="lname"><label>Last Name</label></input><submit

submission="form1"> <label>Submit</label>

</submit>

</xforms>
XHTML:

XHTML stands for EXtensible HyperText Markup Language. XHTML is aimed to

replace HTML. XHTML is almost identical to HTML 4.01. XHTML is a stricter and cleaner

version of HTML. XHTML is HTML defined as an XML application. XHTML is a W3C

Recommendation. XHTML elements must be properly nested. XHTML elements must always be

closed. XHTML elements must be in lowercase.

Example program:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0

Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>

<title>simple

document</title> </head>

<body><p>a simple paragraph</p></body>

</html>

3rd in Assignment- (Transformations)

Unit-2

1) The Web Services Technology Stack:

ThebasestackincludesthosetechnologiesnecessarytocreateandinvokeWebServices.

At the bottom is the network layer, which fundamentally allows Web

Services to be available to service requesters. Although HTTP is the defector standard network
protocol, The architect may consider any of a number of other options, including SMTP(fore-
mail),FTP, IIOP, or messaging technologies such as MQ. Some of these choices are request/response
based, whereas others are message based; furthermore, some are synchronuos, where as others are
asynchronous. The architect may find thatina large sys-tem, a combination of different network
protocols is appropriate
On top of the SOAP layer comes three layers that together form the service description.

WSDL is the de facto standard for service descriptions, with the addition of the still- tentative

WSEL for endpoint descriptions. The service interface definition contains the binding, portType,

message, and type elements, which form the portion of the service description that is reusable

from one implementation to another.

The service implementation definition, however, contains those elements that are specific

to each implementation: the service and port elements. A third party (say, a standards body)

might specify the service interface definition for a particular type of Web Service, leaving the

service implementation definition up to each implementation team.Next comes the endpoint

description, which introduces semantics to the service descriptions that apply to a particular

implementation. Endpoint descriptions can contain security, QoS, and management attributes that

help to define the policies for each of these vertical columns.

Once the architect has dealt with all the issues in the base stack, the Web Services are

essentially fully constructed. Next, the development team uses UDDI to publish the services to a

registry or another repository of information about available Web Services. Once Web Services

are published, UDDI can then be used to discover them in the registries.
2)The Deployment Architectural View:

From Application Servers to Peer-to-Peer:

The Deployment (or Physical) Architectural View maps the software to its underlying

platforms, including the hardware, the network, and the supporting software platforms. Today,

Web Services are hosted on application server platforms such as IBM‘s WebSphere, BEA‘s

WebLogic, and Microsoft‘s Windows 2000. There are many benefits to building Web Services on

top of platforms like these: They handle database access, load balancing, scalability, and interface

support as well as provide a familiar environment for dealing with hardware and network issues.

This model follows a traditional n-tier architecture, except that the Web server is also

responsible for sending and receiving the XML messages that form the Web Services interface.

The technology that supports Web Services is therefore already well under- stood; the

fundamental difference between Web Services and Web pages is that pages are intended for

humans to read, whereas Web Services expose an interface intended for machines.

Running Web Services off of Web servers is not the only way to support the services,

however. It is also possible to build Web Services on a peer-to-peer (P2P) developer model. P2P,

popularized by the Napster music service, is a distributed architecture that does not rely on central

servers but rather distributes responsibility to systems (called peers) in the network. Unfortunately,

P2P technologies are every bit as new and bleeding edge as Web Services, so only time will tell

which P2P models will become established. The self-organizing promise of Web Services does

lend itself to P2P, but a lot of work remains before we will see how this fascinating area will

develop.
Unit-3

WSDL : (Web Services Description


Language)

 Used to describe web services and
written in XML.
 W3C recommendation
WSDL : (Web Services Description
Language)

 Used to describe web services and
written in XML.
 W3C recommendation
WSDL : (Web Services Description
Language)

 Used to describe web services and
written in XML.
 W3C recommendation
Web
Services
Description
Language
• Web
services
description
language
(WSDL)
– The XML-
based service
representation
language used to
describe
the details of the
complete interface
• Exposed by a
Web service
• Specify the way to
access a Web service
– Neither the
service requester
nor the provider
should be aware
of
each other’s
technical
infrastructure,
programming
language, or
distributed object
framework (if
any).
WSDL stands for Web Services Description Language. It is the
standard format for describing a web service. WSDL was
developed jointly by Microsoft and IBM.

Features of WSDL
 WSDL is an XML-based protocol for information exchange in
decentralized and distributed environments.
 WSDL definitions describe how to access a web service and
what operations it will perform.
 WSDL is a language for describing how to interface with
XML-based services.
 WSDL is an integral part of Universal Description, Discovery,
and Integration (UDDI), an XML-based worldwide business
registry.
 WSDL is the language that UDDI uses.
 WSDL is pronounced as 'wiz-dull' and spelled out as 'W-S-D-
L'.

WSDL Usage
WSDL is often used in combination with SOAP and XML Schema
to provide web services over the Internet. A client program
connecting to a web service can read the WSDL to determine
what functions are available on the server. Any special datatypes
used are embedded in the WSDL file in the form of XML Schema.
The client can then use SOAP to actually call one of the functions
listed in the WSDL.

Structure of a WSDL Document

Below is the general structure of a WSDL file

 Definition
 TargetNamespace
 DataTypes
 Messages
 Porttype
 Bindings
 Service

example
<!-- WSDL definition structure -->
<definitions
name="Guru99Service"
targetNamespace=http://example.org/math/
xmlns=http://schemas.xmlsoap.org/wsdl/>
<!-- abstract definitions -->
<types> ...
<message> ...
<portType> ...

<!-- concrete definitions -->


<binding> ...
<service> ...
</definition>

2)SOAP:

What is SOAP?
SOAP is an XML-based protocol for accessing web services over HTTP. It
has some specification which could be used across all applications.

SOAP is known as the Simple Object Access Protocol, but in later times
was just shortened to SOAP v1.2. SOAP is a protocol or in other words is
a definition of how web services talk to each other or talk to client
applications that invoke them.

SOAP was developed as an intermediate language so that applications


built on various programming languages could talk easily to each other
and avoid the extreme development effort.

SOAP Building Blocks


The SOAP specification defines something known as a “SOAP message”
which is what is sent to the web service and the client application.

The below diagram of SOAP architecture shows the various building


blocks of a SOAP Message.
The SOAP message is nothing but a mere XML document which has the
below components.

 An Envelope element that identifies the XML document as a SOAP


message – This is the containing part of the SOAP message and is
used to encapsulate all the details in the SOAP message. This is
the root element in the SOAP message.
 A Header element that contains header information – The header
element can contain information such as authentication
credentials which can be used by the calling application. It can
also contain the definition of complex types which could be used
in the SOAP message. By default, the SOAP message can contain
parameters which could be of simple types such as strings and
numbers, but can also be a complex object type.

Example program
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Tutorial Name" type="string"/>
<xsd:element name="Tutorial Description" type="string"/>
</xsd:sequence>
</xsd:complexType>
Advantages of SOAP

 When developing SOAP based Web services, you need to have


some of language which can be used for web services to talk with
client applications. SOAP is the perfect medium which was
developed in order to achieve this purpose. This protocol is also
recommended by the W3C consortium which is the governing
body for all web standards.
 SOAP is a light-weight protocol that is used for data interchange
between applications. Note the keyword ‘light.’ Since SOAP
programming is based on the XML language, which itself is a light
weight data interchange language, hence SOAP as a protocol that
also falls in the same category.
 SOAP is designed to be platform independent and is also designed
to be operating system independent. So the SOAP protocol can
work any programming language based applications on both
Windows and Linux platform.
 It works on the HTTP protocol –SOAP works on the HTTP protocol,
which is the default protocol used by all web applications. Hence,
there is no sort of customization which is required to run the web
services built on the SOAP protocol to work on the World Wide
Web.

You might also like