Convert Attributes To Elements In XSLT

I was working on some reporting stuff and thought I had an issue where I needed to have elements instead of attributes. I found that the following XSLT would do that conversion for me. 1234567891011121314 <xsl:stylesheet version=”1.0″ xmlns:xsl=””> <xsl:output method=”xml” indent=”yes”/>  <xsl:template match=”@*”> <xsl:element name=”{name()}”><xsl:value-of select=”.”/></xsl:element> </xsl:template> <xsl:template match=”/ | @* |node()”> <xsl:copy> <xsl:apply-templates select=”* … Read more

Composing API Responses For Maximum Reuse With ASP.NET Web API

In Web API 2.1 a new mechanism was introduced for returning HTTP messages that appeared to be a cross between HttpResponseMessage the ActionResult mechanism from ASP.NET MVC.  At first, I wasn’t a fan of it at all.  It appeared to add little new value and just provide yet another alternative that would be a source of confusion.  It wasn’t … Read more

Everything Is Going To Be… 308 Permanent Redirect

The last year has been been a very interesting one.  In April 2014, I announced that I was joining Runscope as a developer advocate. This will be my 50th blog post since that one.  I’ve covered all kinds of topics from the intricacies of HTTP to API design guidelines, tricks for using ASP.NET Web API, reviews of APIs, and summaries of some of the conferences that I … Read more

Centralized Exception Handling Using A ASP.NET Web API MessageHandler

ASP.NET Web API 2.1 introduced some significant improvements to the mechanisms that support global error handling. Before this release, there were a number of different types of errors that would be handled directly by the runtime and there was no easy way to intercept these errors and add your own custom behavior.  The standard guidance suggests … Read more

Caching Resources With Query Strings

This afternoon Scott Hanselman posted a fairly innocuous question on Twitter.  However, the question involved the versioning of a RESTful API, which is a subject that is sure to bring out lots of opinions.  This post is less about the versioning question and more about the commonly held belief that caches do things differently with URLs that … Read more

Back To My Core

I’ve spent a large part of the last two years playing the role of a technical marketeer.  Call it developer advocate, API Evangelist, or my favorite title, API Concierge, my role was to engage with developers and help them, in any way I could, to build better HTTP APIs.  I have really enjoyed the experience … Read more

Azure API Management Resources

Although I know my HTTP and Web API pretty well, becoming an API Evangelist on the Azure API Management team means also needing to know the nitty-gritty of the Azure API Management product too.  In my learning process, I have discovered a wealth of useful information, but it is scattered around a little.  Some is on the Azure documentation site, some on Channel … Read more

API Design Notes: Smart Paging

If you spend any time reading about API design or working with APIs you will likely have come across the notion of paging response data.  Paging has been used in the HTML web for many years as a method to provide users with a fast response to their searches.  I normally spend my time advocating … Read more

A Fresh Coat Of REST Paint On A SOAP Stack

In my experience, once a SOAP API gets into production and is working, nobody wants to touch it.  They can be very finicky beasts. Sometimes the most innocuous update can stop a client application in its tracks.  Exposing a SOAP API to external customers just raises the risk level.  One approach I frequently see is … Read more