Are you working on a REST API and using the new Web API to implement it? You’ve written an ApiController subclass or two? Let’s say you’ve created a new subclass of ApiController called OrderController. WebAPI provides your OrderController with out-of-the-box support for the following URLs:

HTTP Verb URL Description
GET /api/order Returns all orders
GET /api/order/3 Returns details order #3
POST /api/order Create new order
PUT /api/order/3 Update order #3
DELETE /api/order/3 Delete order #3

The above is considered verb-based routing. The URLs above only contain the controller name and an optional id. So the Web API uses the HTTP verb of the request to determine the action method to execute in your ApiController subclass.

Your Goal

Now what if you want to add some custom actions to your ApiController subclass? For example:

HTTP Verb URL Description
GET api/order/3/vendors Returns all vendors involved with providing items to complete order #3
PUT /api/order/3/expedite Expedites order #3, but can only be executed by managers in customer service dept.
PUT /api/order/3/reject Rejects order #3, but can only be executed by managers in customer service dept.

It turns out that adding those custom actions is hard, very hard. But keep reading. There is an easy way. Read More…

Although AIS is proud to center their technology on Microsoft’s frameworks and technology stack, AIS is also adept at working with a broad range of other technologies to give clients solutions that are custom-tailored to their needs.

One such project is the recently released Web Report Editing Tool, or WebRET. WebRET was custom-built in the Ohio Development Center for the specific needs of our government client. In this instance, the client needed a back end that was compatible with the Java Runtime Environment, so we used JRuby on Rails to provide a modern yet JRE-compatible back end.

To learn more about the technologies used in WebRET, take a look at the whitepaper below.

Web Report Editing Tool Case Study (PDF)

Click here to read more about AIS’ custom application development service offerings and how they’ve helped our clients.

So you want to design an app for Windows 8, huh? Moving from designing traditional web pages to apps can be a tough transition, but as designers we need to constantly push and recreate ourselves so that we can stay in touch with the latest technology and trends. So to help, I have some “getting started” tips I want to share.

First, read through Microsoft’s lengthy guidelines for Windows 8 Apps. Make sure you familiarize yourself with the terminology Microsoft uses for the Windows 8 system like hub pages, live tiles and badges. Don’t worry about memorizing everything in the document, just keep it handy and refer to it when you come to that section.

Read More…

As we build applications for more and more platforms, it is extremely important that we maximize our code reuse across platforms. With the release of Windows 8 and Windows Phone 8, Microsoft has made significant improvements in platform convergence – this convergence will continue with each release. They share the same core as Windows, and Microsoft removed .NET compact framework and replaced it with CoreCLR and added WinRT. Much of this is common to Windows 8 itself.

However, it is important to understand that these are still two distinct platforms and still do not have 100% convergence with binary compatibility. Maximizing reuse across these platforms is key to an efficient development experience.

Read More…

Because of our broad knowledge in building web applications, AIS decided to develop a prototype that highlights the features and capabilities of open standards for geospatial processing and data sharing through web applications.

We chose the Visible Infrared Imaging Radiometer Suite (VIIRS) as our data source for the demonstration. VIIRS collects visible and infrared imagery and radiometric data for civil and military Earth monitoring. (The Day/Night Band (DNB) datasets available from NOAA’s Comprehensive Large Array-Data Stewardship System are not quite in the format we need for our application, since they are sensor data records stored within an HDF5 container.)

Read More…

In a production Azure application, our Web roles were repeatedly running into an error in ELMAH that we found nearly impossible to reproduce. It never occurred running in local IIS, IIS Express or anything.

The exact error message was an ArgumentOutOfRangeException:

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate
     at System.Web.HttpCachePolicy.UtcSetLastModified(DateTime utcDate)
     at System.Web.HttpCachePolicy.SetLastModified(DateTime date)
     at System.Web.UI.Page.InitOutputCache(OutputCacheParameters cacheSettings)
     at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     at System.Web.UI.Page.ProcessRequest()
     at System.Web.UI.Page.ProcessRequest(HttpContext context)
     at System.Web.Mvc.OutputCacheAttribute.OnResultExecuting(ResultExecutingContext filterContext)
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)
     at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
     at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass27.b__24(IAsyncResult asyncResult)
     at System.Web.Mvc.AsyncController.<>c__DisplayClass19.b__14(IAsyncResult asyncResult)
     at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
     at System.Web.Mvc.AsyncController.EndExecuteCore(IAsyncResult asyncResult)
     at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
     at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.b__4(IAsyncResult asyncResult)
     at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously

Notice anything missing?

Everything is in the “System.Web” namespace, meaning that all of this is framework code and not application code. This begs the question: Why is this happening?

Apparently, something in the framework (which was indirectly affected by our app) was causing this.

After many, many weeks of on again, off again debugging, I finally discovered the problem:

Read More…

When dealing with a web “farm” situation, there are various reasons a developer needs to identify which machine responded to a request, especially when dealing with particularly nefarious bugs.

Recently, an Azure production application I was monitoring was experiencing a problem with stale/old data showing up intermittently as users navigated the website. I began to suspect a single instance of the application did not have a properly updated cache on it. I needed to know which Web Role Instance was causing the problem so I could restart it. Obviously, there was a bug that would need to be tracked down in the future, but the immediate need was to stop the problem.

For lack of other information, I had to restart each instance of the web role individually, waiting for that one to come back up and move on to the next. I couldn’t trust the situation until every single instance was restarted.

Read More…

Amazon Web Services (AWS) provides an extremely flexible set of services for hosting web applications in the cloud with a web-based console for selecting options to quickly provision a set of IT resources. This post will explore the various aspects of hosting a custom .NET web application in AWS, focusing on high-availability options and disaster recovery scenarios and how to do so under cost constraints.

When building a solution in AWS you have to understand the difference between affinity and availability, and the terminology that Amazon uses. We will define affinity as the physical location of resources within a data center and availability as the isolation of resources for disaster recovery scenarios.

The AIS solution I’ll reference throughout this post uses a Virtual Private Cloud (VPC) to enable our engineers to develop a multi-tiered application within a private sub-netted network split across two availability zones. The VPC as defined by Amazon allows for “… you to create a virtual network topology—including subnets and route tables—for your Amazon Elastic Compute Cloud (Amazon EC2) resources.” The use of a VPC ensures you have high affinity for your EC2 resources. Availability zones refer to the geographically separated data centers Amazon uses for hosting EC2 resources.  Therefore, your disaster recovery architecture must account for placement of EC2 resources in different Availability Zones.

High Availability vs. Disaster Recovery in AWS

To muddy the terminology waters further, we have the concept of high availability, where the effects of hardware or software failure are essentially masked and downtime for end users reduced, such as in Microsoft’s SQL Server. Our solution had to address the issue of high availability and allow for a swift recovery in the event of a disaster or failure of EC2 resources in one availability zone. A high-level picture of what we needed to achieve is shown below.

Read More…

Let me state at the outset, I have no intention to compare “JavaScript with HTML” and “C# with XAML” styles of building Windows Store Apps. This is a choice you have to make based on your skillset, reuse considerations (i.e. do you plan the target the app for Windows 8 and Windows Phone 8 OS), whether the functionality you are targeting for the app is already available as a web app or not, etc.

For last several years I have focused on the web technologies, starting with server-side technologies but lately client-side single-page style apps. So the h5c3js model is more suitable based my skillset. (Additionally, my knowledge of XAML is limited to WF serialization format.)

This model, which allows HTML-based native Windows 8 apps, is innovative in my opinion and I applaud the folks responsible for the language projection in Windows RT.

Read More…