30 Apr

401 Unauthorized error on MERGE operations IIS 7 with WCF Data Service

I was getting this error when using WCF Data Services and trying to save an update to an object.  After quite a bit of googling, I found a work around that I didn’t like.  Allow the users write access to the .svc file.

I have a hard time believing that anyone would accept “allow the user write access to the file” as an answer in web situation.  In my case I was able to use that as a temporary fix because the website in question was internal and behind a firewall, but I knew there had to be a better answer.

UsePostTunneling

Post tunneling allows you to use your REST service with just the Post and Get verbs, and puts a little something extra in the header so that the service knows to treat the Post as a Merge, Put or Delete verb.  For WCF Data Services, all you need to do is set the UsePostTunneling property on the Context to true.

Here’s sample code from anonymized from my dataservice factory:

public static MyDataSvc.MyDataEntities GetDataSvc()
{
    Uri SvcUri = new Uri(string.Format("http://myserver.com/", "dataservice.svc"));
    var context = new MyDataSvc.MyDataEntities (SvcUri);
    context.UsePostTunneling = true;
    return context;
}
23 Apr

Why am I blogging? Because Scott asked me to

Seriously, Scott Hanselman, one of the premier software development bloggers and all around dev guru, asked me to blog.  He wrote a whole blog post about how important he thought it was that I start blogging.  It seems he really thinks I have something to add to the conversation, and that someday he will find answers to some of his questions when a Google search turns up my blog.

OK, so he wasn’t speaking specifically to me, but I had been thinking about starting to blog because I’m at a point where I do think I have something to add to the conversation, and I may actually be able to post about a coherent article on some problem I’ve overcome that took researching 3+ pages deep in Google results for a hint that pointed me in the right direction.

Basically I was ready to start blogging, and Scott just pushed me over the edge.  And for that I say thanks.

**I was watching a video of one of Scott’s presentations where he said that he wants to beat out Scotts toilet paper as the top result when searching for Scott.  To do that, he proposed that when linking to his site everyone link on the word Scott.  I’m not sure if he was joking, but I went with it anyway.

22 Apr

The greatest feature of all

Today was a big day in my life as a developer.  I added the most important feature to my application.  This is the first time I have ever added a feature of such magnitude to an application I wrote as a side project.  You might be wondering what this wonderful feature of which I speak?

SHIPPING!!!

Did it really need to be in bold, with 3 exclamation points?  Yes, I think it did.  This is a huge accomplishment on a personal level.  I have started and not finished at least a dozen other projects in my life.  The all start out the same way.  I think “Hey, this technology is really cool, I should build something.”  I find an idea and after I’ve fully explored the technology, I never finish the last 20% of the project.  You know the 20% that takes 80% of the effort.

I always learn a lot from these side projects, but this is the first time I’ll really have something to show for it.  Am I proud of the code?  Absolutely not.  I was working with an open source chess engine (from ChessBin.com) to setup the board and validate moves.  I had to do some things that made me cringe at times to get things working.  The alternative was to spend weeks refactoring the chess engine with the hope of not breaking it while converting it from something designed for WinForms to something designed for MVVM.  I chose the shortcut so that I could add other features, like shipping.

Is my app going to change the world?  Is it going to make me rich?  Absolutely not.  I expect to get dozens of downloads per year, and hope to make back the $99 I paid to publish it over my lifetime.

Will I try to publish another loss producing app in the future?  Yes.  This whole thing has been a great learning experience, both development and product management wise.  I’m sure I’ll learn a lot about marketing in the coming months as well.

If you have a Windows Phone please check it out.  If like it give me a nice 5 star rating.  If you don’t like it send me an email and tell me what you’d do differently.