Delphi-Kylix
  Home arrow Delphi-Kylix arrow Page 2 - Web Services Made Easy With Delphi
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DELPHI-KYLIX

Web Services Made Easy With Delphi
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2006-10-23

    Table of Contents:
  • Web Services Made Easy With Delphi
  • Why use XML (eXtensible Markup Language)?
  • Why SOAP (Simple Object Access Protocol)?
  • Web Service Description Language (WSDL)

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Web Services Made Easy With Delphi - Why use XML (eXtensible Markup Language)?


    (Page 2 of 4 )

    XML is an extensible mark-up language that enables you to identify and organize your information in a more accurate and flexible way. It is called extensible because it does not have a fixed format, as does HTML, which is an SML or Single Markup Language. 

    For example if you want text to appear bold in HTML you place the text between the "<b></b>" tags. Every browser knows what to do when they encounter these tags. If however, you change these tags to "<bold></bold>" then browsers would not know what to do with them, since they are only programmed to recognize the "<b></b>" as meaning bold. 

    In contrast to this, XML does not have any predefined tags; rather, it allows you to create your own tag sets to both display and format text. All you have to do is add a (XSL) stylesheet to enable the browser to format your text. This language can therefore be read and understood on any computer platform, and it is precisely because of this flexibility that web services uses XML to format its messages. The most visible use of XML is in RSS documents, which are used to make news content available on the Internet. Below is an example of an RSS document:

    XML code:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="generic.xsl"?>
    <!-- Copy and paste the url into your newsreader application" -->
    <!-- generator="Movable Type/2.64" -->
    <rss version="0.91">
      <channel>
         <item>
          <title>RSS Syndication </title>
          <link>http://www.examplesite.com</link>
          <description> The UK newspaper that does not have an RSS
    feed??</description>
        </item>   

        <item>
          <title>Education in Crisis??</title>
      <link>http://www.examplesite.com</link>
      <description>The problem of classroom shortage in UK Schools</description>
    </item>
        <item>
          <title>RSS XML Reader</title>
      <link>http://www.examplesite.com</link>
      <description>A new program that reads xml files. </description>
    </item>
          </channel>
    </rss>

    The line "<?xml-stylesheet type="text/xsl" href="generic.xsl"?>" specifies the name of the style sheet that is used to format the information. In this case the file is called "generic.xsl." Below is the style sheet code that enables the XML code to be formatted:

    <?xml version="1.0" ?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" encoding="iso-8859-1" omit-xml-
    declaration="yes" indent="yes"/>
    <xsl:template match="*">
    <table border="1" width="600" align="center">
    <tr><td valign="top" align="center" class="title"
    bgcolor="silver" >
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="*[local-name()='channel']/*[local-name()
    ='link']"/>
    </xsl:attribute>
    <xsl:attribute name="target">
    <xsl:text>top</xsl:text>
    </xsl:attribute>
    <xsl:value-of select="*[local-name()='channel']/*[local-name()
    ='title']" disable-output-escaping="yes"/>
    </a>
    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    <xsl:value-of select="*[local-name()='channel']/*[local-name()
    ='lastBuildDate']"/>
    </td></tr><tr><td valign="top" bgcolor="ghostwhite"
    class="headlines" >
    <ul>
    <xsl:for-each select="//*[local-name()='item']">
    <li>
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="*[local-name()='link']"/>
    </xsl:attribute>
    <xsl:attribute name="target">
    <xsl:text>top</xsl:text>
    </xsl:attribute>
    <xsl:value-of select="*[local-name()='title']" disable-output-
    escaping="yes"/>
    </a>
    <xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
    <xsl:value-of select="*[local-name()='description']" disable-
    output-escaping="yes"/>
    </li>
    </xsl:for-each>
    </ul>
    </td></tr>
    </table>
    </xsl:template>
    <xsl:template match="/">
    <xsl:apply-templates/>
    </xsl:template>
    </xsl:stylesheet> 

    I will not be explaining how style sheets are created because that is an entire subject in its own right. But here is what you get when you combine the two:

    To summarize:

    • XML gives you the ability to 'package' your information in anyway you like, i.e. you can create your own tag sets and still have the same advantages offered by HTML, like text formatting.
    • XML is platform independent.
    • XML is language independent, i.e. you can create a xml document in any language  

    More Delphi-Kylix Articles
    More By Leidago


       · This article explains how to built webservices with Delphi.
     

    DELPHI-KYLIX ARTICLES

    - Delphi Wrapper Classes and XML
    - Delphi and the DOM
    - Delphi and XML
    - Internet Access: Client Service
    - Finishing the Client for an Internet Access ...
    - The Client for an Internet Access Control Ap...
    - User Management for an Internet Access Contr...
    - Important Procedures for an Internet Access ...
    - Server Code for an Internet Access Control A...
    - Constructing the Interface for an Internet A...
    - Building a Server Application for an Interne...
    - Building an Internet Access Control Applicat...
    - Client Dataset: Working with Data Packets an...
    - Using the Client Dataset in an N-Tiered Appl...
    - Using the Client Dataset in Two-Tiered Clien...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT