Unit testing web services

Last post 05-04-2006 2:02 PM by BradleyB. 1 replies.

Sort Posts:

  • Unit testing web services

    05-04-2006, 5:31 AM
    • Member
      25 point Member
    • PhilLee
    • Member since 04-18-2006, 12:41 PM
    • Posts 5

    Before I converted my web service to use WAP I had a unit test project that referenced the web service ( in the same solution).  I could then start unit tests and the web service would start and unit tests and code coverage would work.

    Now I have converted to WAP I can't get unit tests to work any longer because the web service doesn't auto start.  Note that I recreated the unit test project from scratch.

    Any ideas?

  • Re: Unit testing web services

    05-04-2006, 2:02 PM
    • Participant
      1,171 point Participant
    • BradleyB
    • Member since 11-06-2002, 10:53 AM
    • Posts 227

    Hey Phill, unfortunatley WAP was developed after Team Test so Team Test does not currently recognize it as Web project and generate the right proxies.

    You can however still get this scenario to work.  To do this create a Web Site web service project with the same web methods.  You don't need an implementation just the signature.  Create a Test Project for this and generate the proxies.  Once generated you can copy the source files over to the Test project for Web Application.

    As far as starting the Web Severce you can configure the solution to have multiple startup projects.

    1. Choose the Solution node in the Solution Explorer
    2. Select “Set Startup Projects…”
    3. Select “Multiple startup projects” and choose your web service and project which accesses the web service.
    4. Debug your application by pressing F5. You will see both projects running.

    The good news is that we're making every effort to fix this scenario in VS SP1 so that it works out of the box.

    Hope this helps,
    Brad.

Page 1 of 1 (2 items)
Microsoft Communities