Lab3 Field API Web Intro

(This is a continuation from the previous post: Lab2 “Field API Intro”)

So far, we have written a program that is a desktop client application. Next, we will write a simple ASP.NET web application. For now, we keep the basic functionality same as Lab2 (i.e., login, get a list of project names, get a list of issues, and create an arbitrary issue). Later on in the Lab4, we will add a simple chart as a way to demonstrate reporting as a possible use case scenario.

The good news is that we have written the functions to make the Field web services REST calls in a way that we can simply reuse them. In the sample project, we put the common Field REST calls under Field folder. You can simply copy the folder to your web application if you have followed lab1 and 2.

2015_0414 Lab3FieldApiWebIntro1

Instead of Win Form, we use Web Form when we choose a project in Microsoft Visual Studio (MSVS). For this exercise, a simple single web page will be enough. MSVS ASP.NET development environment provides you a set of tools that is analogous to win forms tools. If you have been programming a windows application using Visual Studio, it will look familiar to you.

Difference is, of course, the UI is a web page. A web page in ASP.NET has an extension “aspx”. ASP.NET tools starts with “asp:” in a web form. A code behind an aspx page has an extension “aspx.cs”. In the corresponding code, most of the implementation is analogous to the Win Forms. Only difference is that to save values between different REST calls, we use HttpContext.Current.Session object instead of using a member variable, e.g.,

// Save the ticket for this session
Session[“ticket”] = ticket;

// Retrieve the ticket for this session
string ticket = Session[“ticket”] as string;

The image below shows an example of how an application might look like:

2015_0414_Lab2FieldApiWebIntro2

As of this time of writing, Field API is composed of only REST API (as oppose to JavaScript layer that Glue and View and Data API have). As far as Field API REST calls are concerned, we have covered THE basic of making the calls. The rest will be an application of what we have learned so far. We intend to make blog posts with additional topics as we go along experiencing with Field API.

The next post will be an “extra bonus” lab; we will add a simple chart reporting the number of issues to the web page.

You can download the Field API Intro Labs code from here.

Next: Lab4 “Field API Web Intro Ex”

Mikako

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s