views:

142

answers:

1

I want to use Fitnesse to do a subsytem testing of a WCF service.

Now to test a WCF service should I add the 'WebReference', and to add the webreference I require to host the service somewhere?

I believe Fitnesse as a new consumer to the service and it should add the WebReference.

+2  A: 

For WCF, you should use "Add Service Reference" in Visual Studio, or svcutil.exe on the command line.

You can either add the reference from a running service (and then it needs to be hosted somewhere, yes), or you can extract the metadata (the WSDL that describes the service operations and the XSD that describe the message structures; again, using svcutil.exe) to files and create your client side proxy from those files.

If you only want to test the actual service implementation (without the WCF plumbing in between), you could of course also just add a normal reference to the assembly where your service implementation lives (which you hopefully isolated into a class library!), instantiate the service class, and call the methods on it. Depends on what you really want to test here...

Marc

marc_s
We are having class library and WCF sitting on that classlibrary.But we are having xml files (Data) which are sitting in App_Data folder of WCF project. In the class library I am using 'CurrentDomain' path and pick '/App_Data/xmlfile' from config so that it is able to look at the right path. But when I start adding the reference of the library fitness starts failing as its not able to see the APP_Data folder, it only works when I host the service on iis and fitnesse has the Service reference of it.
Miral
The basic question is should we host the service on IIS and Fitnesse should look at that and add ServiceReference ?
Miral