Centralizing and simplifying WCF configuration with SO-Aware part II: Configuration models
In previous posts I've described how we can use SO-Aware to centralize the configuration of WCF services avoiding the need of maintaining complex configuration files across services and clients. The mechanism is enabled by a custom WCF service host which downloads the configuration from SO-Aware's OData feed and reconfigures the target WCF service
The current version of SO-Aware enables a couple of models for centralizing and simplifying WCF configuration: service-centric and binding/behavior-centric. Let's explore both model using a sample WCF service configured with the ws2007HttpBinding and the mutual certificates security profile. To enable this scenario, the binding configuration should be stored in SO-Aware as shown in the following figure.
Similarly, the behavior used to configure the certificate credentials can also be configured in SO-Aware as illustrated in the following figure.
Our sample service is configured in SO-Aware using the bindings and behaviors explained above. The highlighted sections in the following two figures illustrate this process.
At this point, we can reuse SO-Aware’s configuration in our sample WCF service. The current version of SO-Aware enables two fundamental models for accomplishing that: service-centric or binding/behavior centric.
Service-centric
On this model the entire service configuration will be driven by SO-Aware. This entails service and endpoint configurations including bindings and behaviors. We can enable this model by indicating the service version to be configured using the name attribute of the service configuration section as illustrated in highlighted section of the the following code.
1: <serviceRepository
url="http://localhost:9999/SOAwarePortal/ServiceRepository.svc">
2: <services>
3: <service name="ref:CRMSOAPService(1.0)@dev"
4: type="Tellago.ServiceModel.Governance.Samples.CRMSOAPService,
5: Tellago.ServiceModel.Governance.Samples.SOAPServices"/>
6: </services>
7: </serviceRepository>
Binding/Behavior-centric
This model represents an alternative to the service-centric model on which we can configure the specific bindings and behaviors that should be configured from SO-Aware. The following code illustrate that model.
1: <serviceRepository
2: url="http://localhost:9999/SOAwarePortal/ServiceRepository.svc">
3: <services>
4: <service name="Tellago.ServiceModel.Governance.Samples.CRMSOAPService"
5: behaviorConfiguration="ref:ServiceCredentialsBehavior">
6:
7: <endpoint binding="ws2007HttpBinding"
8: bindingConfiguration="ref:MutualCertBinding"
9: contract="Tellago.ServiceModel.Governance.Samples.ICRMService" >
10: </endpoint>
11: </service>
12: </services>
13: </serviceRepository>
Whether the service-centric models definitely offers a more transparent model for simplifying WCF configuration, the binding-behavior-centric model allows the developer to use specific bindings or behaviors already deployed in SO-Aware’s repository.
As always, remember you can download the express edition of SO-Aware at http://www.tellagostudios.com/download