Saturday, April 26, 2014

Hosting WCF service on IIS

Check whether you have IIS installed on your machine or not. If you don't have check below link.

Create a WCF service in Visual studio as shown in the below screens

And create an endpoint as shown in below config settings.

      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />

                <behavior name="ServiceBehavior">
                    <serviceMetadata httpGetEnabled="true"  />
                    <serviceDebug includeExceptionDetailInFaults="true" />
          <behavior name="EndpBehavior">
        <service behaviorConfiguration="ServiceBehavior" name="WCF_Tutorials.Service1">
          <endpoint address="" binding="webHttpBinding" contract="WCF_Tutorials.IService1" behaviorConfiguration="EndpBehavior"></endpoint>
        <endpoint address="mex"
                  contract="IMetadataExchange" />
        <!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
            multipleSiteBindingsEnabled="true" />-->

Once you are done with the creation of WCF service, you can host the service in IIS as shown in the below images.

Run-> inetmgr

Provide Alias Name and Physical Path information in the popup screen

Then create new virtual directory under newly created application

Provide Alias name and physical path information

It done with your hosting on IIS. Test your service as follows


Post a Comment

Subscribe to Post Comments [Atom]

<< Home