Friday, August 19, 2005

web services/FxCop gotcha: changing capitalization

I deployed a web service project yesterday and started testing and I was getting null response from the service, but of course when I was testing the web service on my machine it would work fine, so I started debugging and came to the conclusion that the test client was sending empty parameters to the service call, so I updated the web reference on the test project and everything started working on the production environment
After giving it some thought last night, I came to the conclusion that what caused this was that I put the web service project through FxCop and I had done some changes, and so I suspected that I had changed the signature of one of the functions, but only on the capitalization of the parameters, like
MyFunction(string TrackingID)
MyFunction(string TrackingId)

because that's what FxCop recommends, came in this morning, went to the source code repository to compare the actual version to one of the first versions and confirmed the above

so there you have it, be careful when using FxCop and changing the capitalization of variables around, if you change the capitalization of the parameters the call to the webservice/function will still work! but it will not return the expected results

No comments: