June 26, 2019 11:58 by
Peter
In this tutorial, I’ll explain how to install WCF in IIS 8.0. So in order to host our WCF Service in IIS, use the following simple step-by-step approach. First, Add a website to our solution. select the “ASP.NET Empty web Site” example. For web location, select “HTTP” rather than “File System” and provide the path and press the “OK” button.
Next step, add the Reference of the StudentService project to our web site, in other words StudentIISHost.
Next, Add a reference of System.ServiceModel to the web site. And then, Add a new .svc file to our web site project as.
Then write the following configuration for System.ServiceModel in the web.config :
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name=”StudentServiceBehavior”>
<serviceMetadata httpGetEnabled=”true”/>
<serviceDebug includeExceptionDetailInFaults=”false”/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration=”StudentServiceBehavior” name=”StudentService.StudentService”>
<endpoint address=”http://localhost/StudentIISHost/MyStudentHost.svc”
binding=”wsHttpBinding”
contract=”StudentService.IStudentService”>
<identity>
<dns value=”localhost”/>
</identity>
</endpoint>
<endpoint address=”mex”
binding=”mexHttpBinding”
contract=”IMetadataExchange”/>
</service>
</services>
</system.serviceModel>
Finally, Access the hosted WCF Service, in other words StudentService using the following path.
http://localhost/StudentIISHost/MyStudentHost.svc
I hope this WCF Tutorial will help you to understand the implementation for hosting a WCF Service in Internet Information Services (IIS).
IIS 8.0 Hosting with Free ASP.NET Hosting
Try our IIS 8.0 Hosting with Free ASP.NET Hosting today and your account will be setup soon! You can also take advantage of our Windows & ASP.NET Hosting support with Unlimited Domain, Unlimited Bandwidth, Unlimited Disk Space, etc. You will not be charged a cent for trying our service for the next 3 days. Once your trial period is complete, you decide whether you'd like to continue.