1. Create a virtual directory in the IIS for the service.
2. Create two files in the virtual directory folder. One is the web.config and the other one somename.svc.
3. Now copy the content of <system.ServiceModel> in the app.config file of the WCF Service Library into the web.config.
4. Add the following content in the .svc file:
<% @ServiceHost Service="Namespace.MyServiceClass" language="C#" debug="false" %>
<%@ Assembly Name="Assembly Name" %>
From our previous examples in Part 1 and Part 2, it should be as follows:
<%@ ServiceHost Service="HelloWorld.HelloWorld"%>
<%@ Assembly Name="HelloWorld" %>
<%@ Assembly Name="HelloWorld" %>
5. Create a bin folder in the virtual directory and place the HelloWorld.dll generated in the bin\debug folder of the WCF Service Library project.
6. Make sure that the IIS has got sufficient permissions on the folders and files created in the virtual directory.
Note:
In case if your config file has localhost anywhere, change it to the machine name. Otherwise, when you generate proxy using visual studio, your WSDL will have the "localhost" instead of the machine name and if you are trying to access it from another computer it will not work.
For example, http://localhost:9000/HelloWorld should be replaced with http://machinename:9000/HelloWorld.
Hope this helps... Happy coding guys!!!
No comments:
Post a Comment