Web Services
  Home arrow Web Services arrow Page 3 - Accessing Devices Using a Web Service
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  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
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? 
WEB SERVICES

Accessing Devices Using a Web Service
By: Terry Ess
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2004-01-14

    Table of Contents:
  • Accessing Devices Using a Web Service
  • HTTP Requests and Responses
  • XML
  • Web Service Implementation
  • Conclusion

  • 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


    Accessing Devices Using a Web Service - XML


    (Page 3 of 5 )

    The Extensible Markup Language provides a standardized means of describing and transferring data. XML is a meta-markup language, a set of rules for creating semantic tags used to describe data. An XML element is made up of a start tag, an end tag, and data in between. The start and end tags describe the data within the tags, which is considered the value of the element. For example, the following XML element is a <director> element with the value "Matthew Dunn."

    <director>Matthew Dunn</director>

    The element name "director" allows you to mark up the value "Matthew Dunn" semantically, so you can differentiate that particular bit of data from another, similar bit of data. For example, there might be another element with the value "Matthew Dunn."

    <actor>Matthew Dunn</actor>

    Because each element has a different tag name, you can easily tell that one element refers to Matthew Dunn, the director, while the other refers to Matthew Dunn, the actor. If there were no way to mark up the data semantically, having two elements with the same value might cause confusion.

    In addition, XML tags are case-sensitive, so the following are each a different element.

    <City> <CITY> <city>

    An element can optionally contain one or more attributes. An attribute is a name-value pair separated by an equal sign (=).

    <CITY ZIP="01085">Westfield</CITY>

    In this example, ZIP="01085" is an attribute of the <CITY> element. Attributes are used to attach additional, secondary information to an element, usually meta information. Attributes can also accept default values, while elements cannot. Each attribute of an element can be specified only once, but in any order.

    A basic XML document is simply an XML element that can, but might not, include nested XML elements.  For example, the XML <books> element is a valid XML document:


    <books>
    <book isbn="0345374827">
    <title>The Great Shark Hunt</title>
    <author>Hunter SThompson</author>
    </book>
    </books>

    There are some things to remember when constructing a basic XML document:

    1. All elements must have an end tag.

    2. All elements must be cleanly nested (overlapping elements are not allowed).

    3. All attribute values must be enclosed in quotation marks.

    4. Each document must have a unique first element, the root node

    HTTP Request

    Response

    GET /VersionWeb service’s software version
    GET /TimeWeb services’ current local time
    GET /Listener.htmThe example listener Web page
    All other requestsHTTP error response

    Response

    XML

    Software version<SwVersion>
    <Major>integer</Major>
    <Minor>integer </Minor>
    <Rev>integer </Rev>
    </SwVersion>"
    Time<StateTime>
    <Hour>integer</Hour>
    <Minute>integer</Minute>
    <Second>integer</Second>
    </StateTime>

    *Integer – signed integer number

    The HTTP requests are easily made in a Web Browser.  For instance to generate the version request would look like “http://hostname/Version”.  If request compatibility with a full scale Web server, e.g. Microsoft IIS using ASP, is important then the request could be changed to “GET /Get.Asp?WCI=Version".

    More Web Services Articles
    More By Terry Ess


     

    WEB SERVICES ARTICLES

    - Getting Started with Flex
    - Automated Billing and Faxing for the Web
    - An Introduction to Web Services
    - The Foundations of Web Services: From Novice...
    - Web Services Reengineering: Finishing Touches
    - Fault Handling with Web Services
    - Flow and Web Services
    - Process Lifecycles and Web Services
    - Business Processes and Web Services
    - Orchestrating Web Services
    - Notifications and Resources in the WS-Resour...
    - WS Notification and WS Topics in the WS Reso...
    - Introducing the Implied Resource Pattern
    - Web Services and Stateful Resources
    - Deploying an EJB Application







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway