Wireshark Rocks

I love Wireshark. It’s a network protocol analyzer that has saved me countless hours over the last year or so in debugging serialization and HTTP issues on a variety of projects. Today’s success story comes courtesy of Silverlight, WCF and the hazards of leaving slashes off the end of a URL.

I’m working on a project developing a Silverlight app and I’m in the process of adding a logging service on the server side. After I added the framework and skeleton yesterday to implement logging, my Silverlight app started throwing up a “This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?” informational message. This was late in the day yesterday and having zero brain cells left to figure it out, I left it for today, hoping it would magically go away.

Of course, it didn’t. But having rejuvenated the two brain cells I have with two gin and tonics last night, this morning it was clear that Wireshark would be the answer. Instead of spending hours trying to figure out why in the hell I was getting that message, I just fired Wireshark up and followed the TCP stream going back and forth from my app to the server. That told me that the server was returning a 301 Temporary Redirect because there was no endpoint at “http://my_url/without_an_endingslash” but that there was an endpoint listening at “http://my_url/without_an_endingslash/” and so I was being redirected there.

2 minutes using a great tool and I had the answer. I love days like this, rare though they are.