I have two .cs files in one i will specify the Interfaces, and in another file i will implement the interfaces. Now i want to host Service as a WCF Service on IIS. In another way How to host the already existing service(Functionality) as a WCF Service. Thanks in advance.
-
PS: Please help yourself by showing the source code in the two .cs file so that the community can help you. – Larry Morries Oct 13 '11 at 04:09
1 Answers
You have several options:
put your two *.cs files into your
App_Code
directory in a web site and let ASP.NET compile then as needed. You will need to create a service file something like this:YourService.svc
<%@ ServiceHost Language="C#" Debug="true" Service="YourService" CodeBehind="~/App_Code/YourService.cs" %>
put your two *.cs files into a separate class-library project and compile them into a DLL which you put into the
\bin
directory in your web site/web application. You will need to create a service file something like this:YourService.svc
<%@ ServiceHost Language="C#" Debug="true" Service="YourService" %>
This service file tells the IIS runtime how to handle incoming requests for the http://(yourserver)/(virtualdirectory)/YourService.svc
URL.
Now, once everything is setup, you should be able to connect to your service at the service URL using a tool like the WCF Test Client to send SOAP requests (and receive back responses)

- 732,580
- 175
- 1,330
- 1,459