Monday, July 25, 2011

If at first you don't succeed, plug it in

I had created a WCF service to accept some data and had been testing it.  One method was succeeding and the second was failing with a 500 Internal Server Error.  I circled around and around trying to find the solution.  I rebuilt my local proxy, I verified that the methods were in there.  Still no luck.  I then enabled message logging in WCF on the server side.  What was odd was that the first method was logged successfully, but there was no record of the second method call.  I started thinking I was going to need to capture packets with Wireshark and analyse things at the wire level.

You know what I did wrong?  My code was configured to use one endpoint, but allowed the user to change the server for testing purposes.  I was never assigning the new server to client.ChannelFactory.Endpoint.Address.  It's not the complex problems that slow you down, it's always the little things.