in Technology by
How to 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:

<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>

Related questions

0 votes
    How do we host a WCF service in IIS?...
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
    Service Instance per Host pattern provides __________. A. Great Isolation B. Leverage AWS for Autoscaling and Load balancing C. Great Manageability D. All the options...
asked Jan 10, 2023 in Technology by JackTerrance
0 votes
    Service Instance per Host pattern provides ________________ (a)Leverage AWS for Autoscaling & Load balancing. (b)Great Manageability (c)All the options (d)Great Isolation...
asked Oct 21, 2020 in Technology by Editorial Staff
0 votes
    I have a WCF service which is called in 4 different places in my system. It returns approx 500 ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education 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 are the differences between ASP.NET Web Service and WCF?...
asked Jul 26, 2021 in Technology by JackTerrance
0 votes
    What are the main components of WCF Service?...
asked Jul 26, 2021 in Technology by JackTerrance
0 votes
    Im calling a locally hosted wcf service from silverlight and I get the exception below. Iv created a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 22, 2022 in Education by JackTerrance
0 votes
    Im calling a locally hosted wcf service from silverlight and I get the exception below. Iv created a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I have a simple WCF service that I'm exposing using a .svc. The service has some related DataContract ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 11, 2022 in Education by JackTerrance
0 votes
    I am currently developing a WCF service in a windows form application. There would be a simple GUI screen ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 10, 2022 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
...