Transcript Assignments
T-110.5140 Network
Application Frameworks
and XML
Assignments
Contents
Introduction
Laboratory environment
Assignments
requirements, background,
steps
Grading and deadlines
Contact information and office
hours
Assignment groups
Introduction
Two assignments need to be
completed during this course
Each assignment is done as pair work
(you can also do them alone)
Today we look at the assignments in
detail
This information will also be available
on the course homepage
Also more information on using the lab
computers
Assignments
CORBA
SOAP
XML-Schema
Environment
Linux
OpenSwan IPSec support
JDK
Java ORB & IIOP, Apache Axis, Xerces
Machines may be used in the lab (A120)
You can also use SSH to use the
computers remotely
Tentative
CORBA Assignment
Implementation of a simple web client
and server using CORBA and IIOP
CORBA remote operations are used to
download a file from a server machine.
Use of IPSEC on top of IP to secure the
connection
Optional bonus: Keynote 2 trust
management system certificates
CORBA II
The goals of this assignment are
To learn about using ORB, IIOP and
IDL.
To
familiarize with the IPSec
architecture on IPv4/IPv6.
To
study CORBA security using
KeyNote2 and IPSec.
CORBA III
The assignment is done using JDK and
Java ORB and IIOP
IPSec security using Linux and
OpenSwan
Installed on lab computers
Details
Write the web server and client. Use the idlj IDL
compiler that comes with Java2.
Record network interaction between the client and
server with tcpdump (see 'man tcpdump') when you
retrieve a file.
Create IPSec Security Associations
Record network interaction (protected with
Encapsulated Security Payload, ESP) between the
client and server with tcpdump. Compare with the other
dump.
Optional bonus: modify the IPSec setup to use
KeyNote2 certificates or explain in detail how this could
be done.
Return
You need to return:
Java code for the server and the client
Compiled classes
Dump of protected / unprotected
communication (tcpdump)
Optional bonus: details how to setup
Keynote2 certificates
// IDL schema definition for Web server interface.
interface Web_Server
{
typedef sequence<octet> Content_Type;
struct Metadata_Type
{
// Status of the <get> operation. These
// values should map onto the normal HTTP
// status values, e.g., 200 means success, 404
// means "file not found," etc.
short status_;
// Modification date.
string modification_date_;
// Type of content.
string content_type_;
};
// Download the <contents> associated with <pathname>.
// The <metadata> reports information about the <contents>.
void get (in string pathname,
out Content_Type contents,
out Metadata_Type metadata);
};
IPSec Configuration
/etc/ipsec.conf
create a Security Association between
the two machines
Transport-mode or tunnel-mode (ESP,
Encapsulated Security Payload),
symmetric keys
Use manual keying
There are examples on the web page
how to use ipsec with sudo
Background material
CORBA and Java
http://java.sun.com/j2se/1.3/docs/guide/corba/
index.html
IETF IPSec Working Group Charter
http://www.ietf.org/html.charters/ipsec-
charter.html
OpenSwan
http://www.openswan.org/
Keynote
http://www.cis.upenn.edu/~angelos/keynote.h
tml
Questions about the CORBA
Assignment?
SOAP
SOAP (formerly called Simple Object Access
Protocol) is an XML-based lightweight protocol
for exchanging information in a distributed
environment.
SOAP consists of three parts:
an
envelope for describing what is in a
message and how the message is
processed,
a
set of encoding rules for custom datatypes,
and a convention for representing Remote
Procedure Calls (RPC).
A binding
with HTTP
SOAP II
In this assignment you need to deploy
your own simple web service that
provides text search service for clients
using Apache Axis.
Axis is a Java SOAP engine that
includes a stand-alone server, support
for WSDL, tools for generating Java
classes from WSDL descriptions, and
sample programs.
Requirements
The service has a simple index consisting of
filenames and a number of keywords for each
filename.
The keywords are matched against the search
word given by the user.
The service receives three input parameters:
the number of matching documents that are
returned, the search word, and a parameter
indicating whether or not the search is fuzzy
(partial matching or exact matching).
Requirements II
The search service returns the filenames
that have matching keywords in the
service datafile.
The datafile contains filenames and each
filename may have several keywords.
The filenames are returned either as a
string separated by whitespaces or as a
vector of strings.
You will also need to implement a SOAP
client for the service that can be used to
make command-line queries. The client
prints the results to the screen.
Goals
The goals of this assignment are defined
as follows:
To familiarize with SOAP and Web
Services.
To understand concepts such as
XML-based RPC, WSDL,
deployment of web services.
To make SOAP invocations,
process responses and define
service interfaces.
To create a simple Java web
service and a SOAP client
Details
Read
and get to know the SOAP
specification and Apache Axis SOAP API.
Download Apache Axis and perform the
installation (set the classpath..).
Design and implement the service. You can
start from a WSDL description or by writing
the service Java interfaces and code.
Create a simple command-line SOAP
application to access the search service.
Deploy the service, and test your client
program.
Return
Return:
The code for the search service
The code for the client program
Compiled classes
A sample output of the client
accessing the service
Tcpdump or tcp-monitor (Axis tool)
output of the traffic
if you do also the IPSec assignment,
please compare the dumps
WSDL and WSDD descriptions of
your service. WSDL can be machine
generated.
Axis Installation
Download and unzip Apache Axis
Set up your CLASSPATH to contain all the JAR files
in /xml-axis-10/lib and the xml-axis-10 directory. Note
that you need to have an XML parser available. You
can use xercesImpl.jar and xmlParserAPIs.jar from
Xerces2.
Start a simple Axis HTTP server on port 20000 (in a
separate window) by typing:
java
org.apache.axis.transport.http.SimpleAxisServer p 20000
Axis Installation II
Move to the /xml-axis-10/samples/echo directory and deploy
the service:
java org.apache.axis.client.AdminClient -p 20000
deploy.wsdd
Run the client program:
java samples.echo.TestClient -p 20000
The sample program should produce echo test
results.
You can download the machine generated WSDL
description by issuing the following URL to a
browser:
http://localhost:20000/axis/services/echo?WSDL
Background material
TCPMonitor is a useful tool for
monitoring SOAP requests
SOAP
http://www.w3.org/TR/SOAP/
AXIS
Included with Axis
java org.apache.axis.utils.tcpmon [listenPort
targetHost targetPort]
http://xml.apache.org/axis/
Web Services Description Language
(WSDL) 1.1
http://www.w3.org/TR/wsdl
Questions about the SOAP
assignment?
XML Schema Assignment
The XML Schema specifications from
W3C define an XML language for
describing the syntax and structure of
XML documents.
Schemas can be used to define what,
where and how XML elements can be
used. It allows the description of complex
data types and restrictions on existing
types.
XML Schema Assignment II
In this assignment you need to create an XML
schema for a catalog or a library that allows the
description of items in the catalog.
The schema contains an item type for basic
items in the catalog.
This basic item type is extended in order to
create custom item types. Create at least one
custom type in your schema.
Requirements
You need to use the following XML Schema features:
Elements
and attributes
Extension of complex types.
References (ref).
Constraints (cardinality constraints).
Namespaces and multiple schemas (import).
Bonus points: groups, keyref, unique
You need to create an XML instance of this schema that
demonstrates the features of the schema.
You also need to validate the XML instance against the
schema using Xerces from the Apache Group.
Example
isbn-number (complex type with
restrictions on format),
book (basic type),
dictionary (custom type with enhanced
features)
extends basic book-schema
Goals
The goals of this assignment are defined
as follows:
To familiarize with XML Schema.
To understand concepts such as
elements, complex types,
namespaces, extension.
To create XML schemas and use
resources from different schemas.
Details
Read
and get to know the Schema specification
Download Xerces for Java and perform the
installation.
Design and create your schema and an XML file
that is an example of the schema and
demonstrates the features of the schema.
Compile a simple test Java program to validate
the XML file against the schema.
Run the validation program.
Return
Return:
The XML Schema and the XML
instance document
The code for the validator
Compiled classes
A sample output of the validation
program indicating that the validation
succeeded.
Additional bonus: compare XML
Schemas with DTDs or some other
schema specification
Backround material
http://www.w3.org/XML/Schema
http://www.w3.org/TR/xmlschema-0/
http://www.w3.org/TR/xmlschema-1/
http://www.w3.org/TR/xmlschema-2/
http://www.xml.com/
Questions about the XML
Schema assignment?
Grading
Each assignment will be graded with 0, 1, 3 or 5
points according to the following principle:
0p: if you do not meet the minimum requirements
of the exercise
1p: if the requirements are met, but the
assignment does not work properly.
3p: if the requirements are met and the
assignment is properly done.
5p: if the requirements are met, the bonus part is
done, and the assignment is very well done.
Grading II
You must pass both assignments, that
is, 0p in the other assignment means
that you will fail, even if the other
assignment was graded with 5p.
The grade for the assignments will be
formed in the following way:
2 points equals grade 1
4 points equals grade 2
6 points equals grade 3
8 points equals grade 4
10 points equals grade 5
Deadlines
Deadline for first assignment 23.3.
Deadline for second assignment 15.5
Grading within approximately 2 weeks of
the submission
Submissions in any order
Contact Information
Send mail to our course address
[email protected]
Or post a message to the newsgroup:
opinnot.tik.naf
Mail about the course
[email protected]
Office hours for consultation:
To be announced.
Groups
Assignments are done as pair work
Each group gets an account and
password to the laboratory
Send an email that contains the names
of the group members
Questions?