Reputation: 4823
I have a small WCF webservice working in my development environment (VStudio 2008, WinXP). I am appreciating being able to use the WCF Test Client at this stage of things.
Currently, the APP.CONFIG of my service (project) contains:
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/Design_Time_Addresses/Contracts/Service1/" />
</baseAddresses>
</host>
ASP.NET Web application projects expose a nice tab in the Project Properties with a radio button allowing you to easily choose:
I am confused about how to best go about configuring this project for use with my IIS localhost webserver. I definitely want to retain the ability to use the WCF Test Client. So much configuration seems to occur "behind the scenes" and I'm concerned about breaking my testing environment. Hope you can help me and suggest best practices for these objectives.
EDIT: Here is snippet of solution file as it is now:
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts", "Contracts\Contracts.csproj", "{BC414788-5E5B-4584-9350-B4DD6129665A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Service", "Service\Service.csproj", "{252DE277-D864-4423-BED5-33A8B5ABCAB7}"
EndProject
Upvotes: 1
Views: 1990
Reputation: 754538
If you host your WCF service inside IIS, you'll need to create a virtual directory, and a "myservice.svc" file (there's tons of docs on how to do this).
In this case, your URL will be
http://localhost/(your virtual dir)/myservice.svc
and whatever is in the app.config file will be ignored.
WcfTestClient and all those neat tools should continue to work just fine.
Marc
PS: Cwoo has a great link there - actually, Aaron Skonnard has a whole slew of introductory and advanced videos on WCF. You might want to check them out at the "Endpoint TV" show on Channel 9 - loads of good stuff!
PPS: or go here to the Pluralsight screencast section and click on the "WCF Basics" tag in the cloud to get the more basic WCF screencasts to get you started - excellent stuff!
Upvotes: 1