O'Reilly logo

Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications by Steven Cheng

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customizing IIS ServiceHost via ServiceHostFactory

When hosting in an IIS server, the WCF service and endpoints configuration are, by default, loaded from the Web.config file. So, developers do not need to explicitly create and initiate the ServiceHost like we do in a self-hosting scenario. Sometimes, however, we still need to customize the service or endpoints through code. This recipe will use a custom metadata configuration case to demonstrate how to programmatically adjust service behaviors in an IIS-hosting scenario.

How to do it...

Here we will go through the steps of applying a customized ServiceMetadataBehavior into an IIS-hosted WCF service:

  1. Create the WCF service in the hosting web application.

    We can simply create a new WCF service by adding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required