40
T-110.5140 Netwo Application Frameworks and X Assignments

T-110.5140 Network Application Frameworks and XML Assignments

Embed Size (px)

Citation preview

Page 1: T-110.5140 Network Application Frameworks and XML Assignments

T-110.5140 Network Application Frameworks and XML

Assignments

Page 2: 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

Page 3: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 4: T-110.5140 Network Application Frameworks and XML Assignments

Assignments

CORBA SOAP XML-Schema

Page 5: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 6: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 7: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 8: T-110.5140 Network Application Frameworks and XML Assignments

CORBA III

The assignment is done using JDK and Java ORB and IIOP

IPSec security using Linux and OpenSwan Installed on lab computers

Page 9: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 10: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 11: T-110.5140 Network Application Frameworks and XML Assignments

// 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);};

Page 12: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 13: T-110.5140 Network Application Frameworks and XML Assignments

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.html

Page 14: T-110.5140 Network Application Frameworks and XML Assignments

Questions about the CORBA Assignment?

Page 15: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 16: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 17: T-110.5140 Network Application Frameworks and XML Assignments

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).

Page 18: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 19: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 20: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 21: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 22: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 23: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 24: T-110.5140 Network Application Frameworks and XML Assignments

Background material

TCPMonitor is a useful tool for monitoring SOAP requests Included with Axis java org.apache.axis.utils.tcpmon [listenPort

targetHost targetPort]

SOAP http://www.w3.org/TR/SOAP/

AXIS http://xml.apache.org/axis/

Web Services Description Language (WSDL) 1.1 http://www.w3.org/TR/wsdl

Page 25: T-110.5140 Network Application Frameworks and XML Assignments

Questions about the SOAP assignment?

Page 26: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 27: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 28: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 29: T-110.5140 Network Application Frameworks and XML Assignments

Example

isbn-number (complex type with restrictions on format),

book (basic type), dictionary (custom type with enhanced

features) extends basic book-schema

Page 30: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 31: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 32: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 33: T-110.5140 Network Application Frameworks and XML Assignments

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/

Page 34: T-110.5140 Network Application Frameworks and XML Assignments

Questions about the XML Schema assignment?

Page 35: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 36: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 37: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 38: T-110.5140 Network Application Frameworks and XML Assignments

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.

Page 39: T-110.5140 Network Application Frameworks and XML Assignments

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

Page 40: T-110.5140 Network Application Frameworks and XML Assignments

Questions?