WCF Web Service Hosting

Jul 31, 2007 at 7:08 PM
I've just finished writing a very simple WCF Web Service and test it using the Host and Client projects that are created by WSSF, but now I would like to host my service and I have no idea how to that... since I've read that WCF services are hosted in a different way compared with asmx services.

Does anyone have an example on how to this? I have Win Server 2003 with IIS and I'm using WSSF 2.0 from December.

thanx!
Aug 1, 2007 at 11:40 PM
another doubt is ... where do I put the clients of the WCF web service?, or how do I consume the just created WCF web service. I'm using the test client right now but if I Add an ASP.NET web site to consume the service, I don't have the "Add Service Referece" recipe... so I have no idea how to add a wcf web service to a web client.

Hope anyone can help me with this 2 anoying doubts!
Aug 2, 2007 at 7:14 AM
I host my WCF Services in IIS . I am using Vista and IIS 7 which makes the job easier. You can look here - -http://chakkaradeep.wordpress.com/2007/06/28/internet-information-services-version-7-iis-7/, but that covers with IIS 7. It may give you some idea.

And here - http://chakkaradeep.wordpress.com/2007/07/30/adding-a-wcf-service-to-your-application/ is a mini tutorial on adding WCF Service as Reference to your Client

Hope that helps :)

Regards,
Chaks
Aug 2, 2007 at 3:24 PM
ok, so if I understand correctly I just have to treat the WCF web service created with WSSF as a normal WCF web service and lose all the recepies that I use in the tests host - client... Am I correct?

thanks chakkaradeep for answering!
Aug 2, 2007 at 9:38 PM

chan wrote:
ok, so if I understand correctly I just have to treat the WCF web service created with WSSF as a normal WCF web service and lose all the recepies that I use in the tests host - client... Am I correct?


I am not sure what you are telling, but by having the services.svc and web.config you can host wcf in IIS without losing any of the WCF functionalities. Hosting in IIS is one of the ways you can expose your WCF Service.
Aug 7, 2007 at 2:20 PM
I think what you want can be achieved like this:

Create a virtual directory that points to your Hosts project (where the .svc files live) and make sure you have the necessary permissions set for the IIS user to access your service.

Edit your Web.Config file in your Client project so that the endpoints instead of referencing 'localhost:{port}' actually reference the new virtual directory.

Voila!

NB//

DONT update the .map files in the 'Service References' folder of the client - for some reason when 'update service reference' ing, you must host the service again in Cassini to update correctly..
Aug 9, 2007 at 1:11 PM
Carphill .. I tried what you suggested and worked perfectly!.. thanks to this approach I can host a WCF web service in IIS6 and consume it from an ASP.NET web page using the proxy class created by the WSSF, and I can avoid using the svcutil that's giving me so much trouble.