in Education by

How do we host a WCF service in IIS?

1 Answer

0 votes
by

IIS hosting: if we are hosting a WCF Service in IIS (version 5 or 6), only the HTTP option is available as the transport protocol. In later versions of Internet Information Services (IIS), we can use any other protocol (TCP/IP, MSMQ, NamedPipes and so on.) as transport protocol.

If we host our service under IIS then we have all the features of IIS like process recycling, ideal shutdown etc. Visual Studio provides two different ways to host our WCF service in a local IIS in all are familiar with Publishing Wizard. Here we will discuss the second way using Visual Studio only in a simple manner to host our WCF service in local IIS. To host the WCF services follow the steps below.

The updated configuration for System.ServiceModel in the web.config will be as follows:

  1. <system.serviceModel>  
  2.     <behaviors>  
  3.         <serviceBehaviors>  
  4.             <behavior name=”StudentServiceBehavior”>  
  5.                 <serviceMetadata httpGetEnabled=”true”/>  
  6.                 <serviceDebug includeExceptionDetailInFaults=”false”/> </behavior>  
  7.         </serviceBehaviors>  
  8.     </behaviors>  
  9.     <services>  
  10.         <service behaviorConfiguration=”StudentServiceBehavior” name=”StudentService.StudentService”>  
  11.             <endpoint address=”http://localhost/StudentIISHost/MyStudentHost.svc” binding=”wsHttpBinding” contract=”StudentService.IStudentService”>  
  12.                 <identity>  
  13.                     <dns value=”localhost”/> </identity>  
  14.             </endpoint>  
  15.             <endpoint address=”mex” binding=”mexHttpBinding” contract=”IMetadataExchange”/> </service>  
  16.     </services>  
  17. </system.serviceModel>  

Related questions

0 votes
    How to host a WCF service in IIS?...
asked Jul 26, 2021 in Technology by JackTerrance
0 votes
    What is REST and how to create a WCF RESTful Service ?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is a Service Proxy in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What are the main components of WCF Service?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What are the possible ways of hosting a WCF service?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    Why we need One Way Service?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    How many ways we can host a WCF service?...
asked Jul 26, 2021 in Technology by JackTerrance
0 votes
    What is Security Implementation in WCF? How many are there?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    How to create Basic HTTP Binding in WCF?...
asked Apr 3, 2021 by JackTerrance
0 votes
    What is WCF Concurrency and How many modes are of Concurrency in WCF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is Transaction Propagation? And how WCF support it?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What are Contracts in WCF? How many Contracts are in WPF?...
asked Apr 2, 2021 in Education by JackTerrance
0 votes
    What is Information cards in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What is Instance Management in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
0 votes
    What you understand by Fault Exception in WCF?...
asked Apr 3, 2021 in Education by JackTerrance
...