Daniel Irvine
Code in a cold climate
  • About

Understanding 403 Forbidden

By daniel On July 18, 2011 · Leave a Comment

There’s a problem with 401 Unauthorized, the HTTP status code for authentication errors. And that’s just it: it’s for authentication, not authorization. Receiving a 401 response is the server telling you, “you aren’t authenticated–either not authenticated at all or authenticated incorrectly–but please reauthenticate and try again.” To help you out, it will always include a [...]

Continue Reading →

Authorizing REST requests with OpenRasta

By daniel On June 30, 2011 · Leave a Comment

Over the next few posts I’ll discuss how I’ve implemented a variety of HTTP and REST features using OpenRasta. Being somewhat of an OpenRasta novice I can’t say that I’ve solved these problems in the best way possible, or even with total correctness, but the solutions work well enough.

For those new to OpenRasta, the [...]

Continue Reading →

OpenRasta testing wierdness

By daniel On June 24, 2011 · Leave a Comment

I was having trouble today with some OpenRasta tests using the InMemoryHost. The tests passed when run in isolation (i.e. together but as their own unit), but when run in the context of the entire test assembly the tests failed with this exception being thrown:

TestFixture failed: System.TypeInitializationException : The type initializer for ‘OpenRasta.Hosting.HostManager’ threw [...]

Continue Reading →

Applying multiple OpenRasta OperationInterceptors

By daniel On June 10, 2011 · 2 Comments

OpenRasta has the concept on an OperationInterceptor, a special class that runs before and after your handler method is called. It’s useful when you have a cross-cutting action that should apply across all your resources. A couple of typical examples are:

Validation, when you need to validate the incoming resource object on a Put or [...]

Continue Reading →

Beautiful errors with OpenRasta

By daniel On June 9, 2011 · Leave a Comment

Disclaimer: I’m an OpenRasta newbie so what follows may be completely wrong, but it appears to work for me.

Here’s a common feature of web services: when an error occurs during processing of a server request, the server should return a “nice” error message to the client. It goes without saying that the appropriate HTTP [...]

Continue Reading →

Testing RESTful services with OpenRasta

By daniel On June 8, 2011 · 2 Comments

This week I’ve been spending time learning OpenRasta, a .NET framework that’s best described as a super-awesome WCF replacement. In fact it kicks WCF’s butt.

OpenRasta helps you write RESTful web services with very little effort. Not just the implementation but your tests too. Unfortunately the testability of OpenRasta-based systems is something of a [...]

Continue Reading →

Viewing your OpenWrap dependencies from Visual Studio

By daniel On May 25, 2011 · Leave a Comment

Just a quick tip for all OpenWrap users: you can view your resolved assemblies from inside Visual Studio using Class View (Ctrl+Shift+C).

I’ve always preferred the Solution Explorer and so I missed this little trick until recently, coming across it by chance. It’s a great way to check that you’re not accidentally referencing too [...]

Continue Reading →

Entering a new world…

By daniel On January 31, 2011 · Leave a Comment

After a long wait, my Cyclescheme voucher finally arrived in my postbox. I marched into the nearest bicycle shop and purchased a Giant Defy 2 (2009-2010 Model) plus helmet, D-Lock, cycling cap and lights for the princely sum of £700. The bike is an “old” model–old in the sense that there’s a new [...]

Continue Reading →

Button.IsDefault on Silverlight

By daniel On January 29, 2011 · Leave a Comment

If you’re like me, you spend a lot of time chastising UI developers for not following standard UI guidelines, like the one which says dialog boxes should have a default button.

Unfortunately, the Silverlight team at Microsoft seemingly don’t know about that. Yes, shockingly, Button.IsDefault does not exist in Silverlight.

If you get stuck because [...]

Continue Reading →

Avoiding value converters in WPF and Silverlight

By daniel On January 19, 2011 · Leave a Comment

I’ve always had a dislike for WPF value converters, for a variety of reasons.  They can be quite obtuse when reading XAML, and I’m fairly sure they make a nasty dent on application performance.  It always pleases me when I can get rid of them and use another method, so here’s one technique you can [...]

Continue Reading →
← Previous Entries
  • Tweets

    • Confession: This past year, I forgot that I'm a geek. I love technology. I am obsessed with software. And now it's time to be myself again!
    • @Jermolene I can just imagine you outside with your laptop in a cardboard box. That is so completely you. Awesome.
    • What's the best device for writing code outdoors in the sunshine? It's a beautiful day outside and I'm stuck indoors:(
    • RT @randompunter: 10 Check Amazon.co.uk for cheap touchpad. 20 GOTO 10
    • @IJohnson_TNF typical example of a beautiful Ruby blog - http://t.co/6lHzwX2 show me a .NET blog like that!
    • @IJohnson_TNF I think the ruby people are just more shiny
    • Blogs about Ruby are always so much prettier than blogs about .NET.
    • @Oura_In_Flames It's not all that amazing, and very short!
    • @Oura_In_Flames you played the Sonic Generations demo yet? ;)
    • @Oura_In_Flames cheers for the birthday wishes, I've been too busy at work to even think about it...
    • Reading Programming in Scala, and loving it!
    • Learning Scala this weekend... Quite exciting!
    • @serialseb okay, on Thursday ;)
    • @Oura_In_Flames lol thanks
    • After two weeks of dev, finally deployed my OpenRasta app on IIS. Feeling so pleased with myself!
    • Arrived at work for 8am. First time that's happened in years!
    • Last one in the office - again. #deadlines
    • Finishing the evening with a book in bed!
    • @Oura_In_Flames Then I must have done something terribly bad as I just got drenched
    • Dear Mother Nature, please check your wall calendar is on the correct page. It's June, not January. Yes, June. #wet

Daniel Irvine

Pages

  • About

The Latest

  • Understanding 403 Forbidden
    There’s a problem with 401 Unauthorized, the HTTP status code for authentication […]

More

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the RSS feed.
© 2011 Daniel Irvine
Platform by PageLines