Web Services in Practice at UW-Madison

Presentation Materials

Presentation (OpenOffice): https://mywebspace.wisc.edu/npblair/jasig2010/jasig-2010.odp
Example Web Service project download: https://mywebspace.wisc.edu/npblair/jasig2010/example-ws-0.0.1.tar.gz
Example Web Service project site output: https://mywebspace.wisc.edu/npblair/jasig2010/site/

example-ws-0.0.1.tar.gz is a maven project developed using Eclipse and Java 6.
If you wish to run the JAXB XJC tool as I did in the demonstration via Eclipse, you will need to install the following Eclipse plugin:

https://jaxb-workshop.dev.java.net/plugins/eclipse/xjc-plugin.html

Getting started with the example-ws project

Installation

  1. cp build-SAMPLE.properties build.properties
  2. Open build.properties, set tomcat.home to your instance of tomcat (6.0.24 preferred).
  3. mvn clean package
  4. ant clean-deploy

Starting

  1. In a terminal, change directories to the example-ws project directory and run 'ant hsql'. This will start a local hsqldb instance.
  2. In Eclipse, Start tomcat

Interacting

Web Service client accounts (username, password, access):
root, root, EVERYTHING
limited1, limited1, 3 classes
limited2, limited2, no classes

SOAP Service WSDL Address:
http://localhost:8080/example-ws/chub.wsdl

SOAPUI is a great client for (acceptance and/or load) testing the web service.

REST Service:
The REST service is easy enough to test simply in your favorite web browser. The rest methods listed below will prompt (HTTP Basic) for the same credentials used by the SOAP service.

getClass: http://localhost:8080/example-ws/rest/getClass/
getClasses: http://localhost:8080/example-ws/rest/getClasses/

Sample classes:
TermCode: 1104, ClassNumber: 49458
http://localhost:8080/example-ws/rest/getClass/1104/49458.txt?format=xml
http://localhost:8080/example-ws/rest/getClass/1104/49458.txt?format=json

TermCode: 1104, Subject Code: 936, ClassNumber: 962
http://localhost:8080/example-ws/rest/getClasses/1104/936/962.txt?format=xml
http://localhost:8080/example-ws/rest/getClasses/1104/936/962.txt?format=json