How to unit test C# Web Service with Visual Studio 2008

Posted by Steven Behnke on Stack Overflow See other posts from Stack Overflow or by Steven Behnke
Published on 2008-12-16T17:08:36Z Indexed on 2010/04/27 0:53 UTC
Read the original article Hit count: 633

Filed under:
|
|

How are you supposed to unit test a web service in C# with Visual Studio 2008? When I generate a unit test it adds an actual reference to the web service class instead of a web reference. It sets the attributes specified in:

http://msdn.microsoft.com/en-us/library/ms243399(VS.80).aspx#TestingWebServiceLocally

Yet, it will complete without executing the test. I attempted to add the call to WebServiceHelper.TryUrlRedirection(...) but the call does not like the target since it inherits from WebService not WebClientProtocol.

Thanks, Steven

© Stack Overflow or respective owner

Related posts about c#

Related posts about web-services