XML Namespaces - The 'xmlns' Attribute

When using prefixes in XML, also-called namespace for the prefix must be defined.The namespace is defined by the xmlns attribute in the start tag of an element.
 
The namespace declaration has the following syntax. xmlns:prefix="URI".
 
<root>
<x:book xmlns:x="http://www.tibco.com/abc/dfg/">
  <x:index>
    <x:chapter>second</x:chapter>
    <x:page>thirty</x:page>
  </x:index>
</x:book>
 <y:book xmlns:y="http://www.tibcoworldin.com/test">
  <y:author>African Coffee Table</y:author>
  <y:price>90</y:price>
  <y:publisher>INX</y:publisher>
</y:book>
</root>

In the example above, the xmlns attribute in the <book> tag give the x: and y: prefixes a qualified namespace.

Default Namespaces

Defining a default namespace for an element saves us from using prefixes in all the child elements.
It has the following syntax:
 
xmlns="namespaceURI"

This XML carries HTML book information:

<book xmlns="http://www.tibco.com/abc/dfg/">
  <index>
    <chapter>second</chapter>
    <page>thirty</page>
  </index>
</book>

This XML carries information about a Book (price details):

<book xmlns ="http://www.tibcoworldin.com/test>
  <author>African Coffee Table</author>
  <price>90</price>
  <publisher>INX</publisher>
</book>

Why Web Services ?

Web Services = XML + Protocol

Web Services take web-applications to the next level. By using Web services, your application can publish its function or message to the rest of the world. By doing this other platforms can also access the web application.

So once this web application available to the rest of world, other platform can also access and also by doing this can interact with the other platforms which are already using that web.

Many of the major platforms can access the web using web browsers.

Web-applications are simply applications that run on the web. These are built around the Web browser standards and can be used by any browser on any platform.

Use of the web services are

1.Interoperability.
2.Reusable application components.
3.Open Standards XML + open Protocol based.

Components of the web services are

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

What is SOAP ?

SOAP is an XML-based protocol to let applications exchange information over HTTP.
SOAP stands for Simple Object Access Protocol.
  • SOAP is a communication protocol
  • SOAP is a format for sending messages
  • SOAP is designed to communicate via Internet
  • SOAP is platform independent
  • SOAP is language independent
  • SOAP is based on XML
  • SOAP is simple and extensible
  • SOAP allows you to get around firewalls
  • SOAP is a W3C standard

What is WSDL?

WSDL is an XML-based language for locating and describing Web services.
  • WSDL stands for Web Services Description Language
  • WSDL is based on XML
  • WSDL is used to describe Web services
  • WSDL is used to locate Web services
  • WSDL is a W3C standard

What is UDDI ?

UDDI is a directory service where companies can register and search for Web services.
  • UDDI stands for Universal Description, Discovery and Integration
  • UDDI is a directory for storing information about web services
  • UDDI is a directory of web service interfaces described by WSDL
  • UDDI communicates via SOAP
  • UDDI is built into the Microsoft .NET platform

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP