next page page above previous page

Next: REST Web Service via Servlet Up: Lecture 23 Previous: REST Web Services

REST Web Service Example

Directory manager web service could let users

addnew resources/directories to existing directories
deleteresources/directories in these directories
fetchindividual resources in these directories
listresources in directories served by web server

REST style applications would support these operations using HTTP.

DELETEdelete resource/directory among web server documents
GETfetch resource or listing of a directory
PUTadd directory or resource to web server document space

2nd generation web service passes data as XML not as HTML.

Friendly service would support dual use by

Directory listing for service's resources in XML might be

<?xml version="1.0"?>
<?xml-stylesheet version="1.0" type="text/xsl"
            href="http://www2.macs.hw.ac.uk:8080/demo/directory.xsl"?>
<directory xmlns:xlink="http://www.w3.org/1999/xlink"
           xml.base="http://www2.macs.hw.ac.uk:8080/">
 <name>/tomcat-docs/config/</name>
 <folder xlink:href="/tomcat-docs/config/../">../</folder>
 <folder xlink:href="/tomcat-docs/config/printer/">printer/</folder>
 <file xlink:href="/tomcat-docs/config/server.html">server.html</file>
</directory>

giving folders/files in tomcat-docs/config/ in tomcat's webapps/ folder.


Lecture 23XHTML 1.0Slide 5