DPS907 WSA500 Assignment 9 – Fall 2017

Create a legacy SOAP XML web service server app, and a separate client app that can work with a SOAP XML web service. This is the final assignment in the fall academic term.

Read/skim all of this document before you begin work.

 

Due date

Thursday, January 4, 2018, at 11:00pm ET

Grade value: 5% of your final course grade

If you wish to submit the assignment before the due date and time, you can do that.

 

Objective(s)

Demonstrate that you can configure a legacy SOAP XML web service, and then create a client to interact with it.

 

Introduction to the problem to be solved

Adapt an existing and working modern web service app, by adding a legacy SOAP XML web service.

Then, create a new web app (ASP.NET MVC), which will act as a client app. It will be able to call into your legacy web service.

 

Specifications overview and work plan

The following specifications apply to all of your assignments:

  • Follows best practices
  • Implements the recommended system design guidance
  • Customized appearance on the landing web page

For this assignment, here is what we’re looking for:

  • SOAP XML web service – server app – that works with data from the Chinook sample database
  • Client MVC web app, that calls into the server above

 

During the class/session, your professor will help you get started and make progress on this assignment.

Every week, in the computer-lab class/session, your teacher will record a grade when you complete a specific small portion of the assignment. We call this “in-class grading”.

The in-class grading will be announced in-class by your professor.

 

Getting started

In the course’s code example repository, in the “Templates and solutions” folder, you will see an example solution for Assignment 5. You can use that as the base for your “server” app. We suggest that you rename the root folder (in the file system) to “A9Server“. (That will make it easier for you to identify it later.)

Personalize the Index view of the Home controller with the project’s name (A9Server), and your own name etc.

Next, create a new ASP.NET Web Application, as an MVC web app, with no user authentication/security. We suggest that its name will be “A9Client“.

Personalize the Index view of the Home controller with the project’s name (A9Client), and your own name etc.

 

SOAP XML web service – server

As noted above, you can use the professor’s example solution as the base for your server app. Read its info again to refresh your memory about its purpose and functionality.

Build/compile, then run the app to ensure that it works correctly. Test with Fiddler.

As noted above, personalize the Index view of the Home controller with the project’s name, and your own name etc.

Use the technique you learned in this week’s notes to add a WCF Service to the root of the project. The name of your new WCF Service should be: A9Service.svc

 

Use cases for the A9Service.svc

In the base app, the modern Web API controllers handle these use cases:

Employee:

  • Get all
  • Get one
  • Add new
  • Edit existing
  • Command, to set/configure the support rep (employee)

Invoice:

  • Get all

 

In the interface – IA9Service – declare methods that implement the use cases. We suggest that you use method names that are similar to what is found in the Manager class (e.g. EmployeeGetAll(), EmployeeGetById(), etc.) That way they will show up together – alphabetically – on IntelliSense and other lists.

Then, in the inheriting class, implement the methods in the interface. We recommend:

  • Follow the coding suggestions seen in this week’s code examples
  • Blend in the differences that you have learned about this new class (e.g. return types)

 

One big difference in the inheriting class: It does NOT have MVC/Web API style model binding. In other words, “ModelState.IsValid” is not available. (boo!)

However, we can add this functionality (yay!). How? Look at this week’s code example, and study the AddEmployee() method in its service class. Notice this code:

var vc = new ValidationContext(newItem, null, null);
var modelStateIsValid = Validator.TryValidateObject(newItem, vc, null, true);

if (modelStateIsValid)
  {
    // etc.

 

Make sure that you use that technique for the methods that need model validation.

 

Test your work

Test your work on A9Server by using the WCFTestClient.exe program.

 

SOAP XML web service client

Now, work with the A9Client web app project (the new ASP.NET MVC web app).

Leave the A9Server app running. You will need to work with it.

Use the technique you learned in this week’s notes to do the following:

Add a service reference, that points to the “server” app that you created above. We suggest that the “Namespace” name be something short and noticeable, maybe “Chinook”.

In the new Manager class, add methods that implement these two (2) use cases for the Employee entity collection:

  • Get all
  • Get one

The methods will call out to the SOAP XML web service, and return an object or collection (or null).

Next, create an Employees (MVC web app) controller. Implement its “get all” and “get one” methods, with views. Add a link to the list-of-employees resource to the app’s menu.

Here’s what the “get all” view looks like. Click an image to open it full-size in a new tab/window. The first image was generated by the view scaffolder. The second image shows the result of some view editing, to group and gather some related information together, to produce a more readable result.

 

 

Important note: You MUST fix the “Details” hyperlink in the view code. The scaffolder was unable to guess that the “EmployeeID” property was to be used for the identifier. Manually edit that to fix.

 

Better-looking version:

 

 

Here’s what the “get one” view looks like. The first image was generated by the view scaffolder. The second image shows the result of some view editing, to group and gather some related information together, to produce a more readable result.

 

 

Better-looking version:

 

 

Testing your work

If your client app works correctly, then your work has been tested. For this assignment, we do NOT use Fiddler.

 

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

This Assignment 9 has a modified submission process (and is similar to the process for the previous Assignment 8).

We need both projects to be able to grade your work.

Therefore, here is the modified procedure:

  1. Make copies of both projects
  2. For each project, remove its packages, bin, and obj folders
  3. Zip both projects together (in one zip file), and upload to the designated location on My.Seneca/Blackboard before the due date-and-time

 

For example, assume that you are currently viewing a folder named “A9-copy” in File Explorer.

It should have these two sub-folders:

  1. A9Server
  2. A9Client

Select both folders, then zip them into one zip file result.

 

 

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Advertisements
%d bloggers like this: