DPS907 WSA500 Lab 1 (Fall 2013)

Lab 1 enables you to get experience creating a web service with the ASP.NET Web API project template, and get experience using an inspection tool like Fiddler.


DPS907 WSA500 Lab 1 – due Mon Sep 23

Assigned: During Week 3

Due date: Monday, September 23, at 10:00am ET

Grade value: 3% of your final course grade

Grading method: The following will be checked:

  • Your Lab 1 project, which is an ASP.NET Web API
  • Results from Fiddler tests
  • Correct implementation of the specifications
  • Code writing quality, including commenting



Prove that you can implement concepts and techniques from the first two weeks of the course.

If you passed BTI420 or INT422 in the year 2013, then you do not have to complete this lab. However, if you wish to do it anyway, and get feedback on your efforts from your professor, feel free to do so.


Introduction to the problem that you will solve

We need a web service that will demonstrate the knowledge learned in the first two weeks of the course:

  • Tue Sep 3
  • Fri Sep 6
  • Tue Sep 10
  • Fri Sep 13

To generalize, it must be a well-designed and implemented web service that will enable the user to ‘get-one’ and ‘get-all’ from two entity collections.



Think about and then choose something in life that interests you.

Then, identify two (2) data entities that can be modelled by classes. These two entities should be related/associated with each other in some way.

You CANNOT use the two examples that we have used during the first two weeks (Programs and Subjects, or Suppliers and Products). Think of something else – something in life that interests YOU. Also, avoid doing the same idea as a friend/classmate. You don’t want to be intellectually lazy, do you?


Getting started

Your ASP.NET Web API project will be created on your computer, and use the SQL Server instance that was automatically installed with Visual Studio 2012.

Create a new ASP.NET Web API project. Its name will be “lab1”.

To help guide your work, the table in the September 10 class notes (in the section titled “Guide to today’s topics”) shows the tasks that you must complete. In the sections below, additional or helpful info will be presented.

As you make progress on this assignment, remember to “build” your project, to ensure that there are no lingering errors.


Data model

As noted above, your data model will have two (2) entities.

Each entity should have a decent number of properties, with a mix of data types. (For example, a three-property class is too small. A ten-property class may be too big.)

The entities must be related/associated with each other. Maybe one entity has a property that’s a collection of the other entity. Be reminded that you should/must add these navigation properties for both entities (i.e. they point to each other).

Obviously, your project will include a data context and store initializer classes. Create enough initial data to make things interesting. (For example, two objects per entity are too few, but ten or more per entity may be too much and just waste your time.)


View model classes, and repositories

Follow the ‘best practices’ you have learned so far, and make sure that your controllers deliver view model objects and collections. You MUST NOT leak details from your app domain data model.


Controller for the courses

Create an API controller (with empty read/write actions), for each entity.

Implement these GET methods for both controllers:

  • Get all in the collection
  • Get one, by its identifier

Your project DOES NOT have to implement the full range of HTTP methods. (You will do that in a future lab.)

Also, for ‘get-one’ methods that don’t fetch an object, you can use simple feedback to the requestor, by returning ‘null’ or by throwing an exception. In other words, you DO NOT have to implement the full error/exception handling techniques that we covered during Week 3 of the course.


Testing your work 

Use Fiddler to test your results. After Fiddler loads, press F12 to stop auto-capturing.

Use the “Composer” tab to create your queries. After you test your work, you will be saving the results by using Fiddler’s ‘export sessions’ command.

Query your collections:

Query BOTH of your collections.

Ask for the results in both JSON and XML formats.

Query a collection with a known/existing identifier:

Query BOTH of your collections.

Ask for the results in both JSON and XML formats.

Query a non-existent identifier:

As above, query BOTH of your collections.

Ask for the results in both JSON and XML formats.


Fiddler’s left-side list of “Web Sessions” will now be ready to be saved.

In Fiddler, choose File > Export Sessions > All Sessions…

The export format will be “HTTPArchive v1.2”. Click the Next button to choose a save location and specify a filename. Name the file by using your My.Seneca name (and the suggested filename extension). For example, your professor’s file is named “pmcintyr.har”.

After saving, copy that “har” file into your project’s root (so that your professor can view it during grading).


Reminder about academic honesty

You must comply with the College’s academic honesty policy. Although you may interact and collaborate with others, you must submit your own work.


Submitting your work

Here’s how to submit your work, before the due date and time:

1. Locate the folder that holds your “Lab1” project files.

2. Make a copy of the folder, and name it by using the following format:
For example, your professor’s folder name will be “Lab1_pmcintyr”

3. Remove the “packages” folder from this folder (it’s too big to email, and I don’t need it to grade your work); also, remove the “bin” and “obj” folders

4. Compress/zip the folder. The zip file SHOULD be about 1MB in size. If it isn’t, you haven’t followed the instructions properly.

5. Login to My.Seneca. Open the Web Services Architecture course area. Click the “Assignments” link on the left-side navigator. Follow the link for this lab. Submit/upload your zip file.











  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: