|
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
namespace DevAge.ServiceModel.Configuration
{
/*
*
* Here a typical configuration:
<configSections>
<!-- Add devage.serviceModel section handler -->
<section name="devage.serviceModel" type="DevAge.ServiceModel.Configuration.Section, DevAge.ServiceModel" />
</configSections>
...........................
<!-- Specific DevAge.ServiceModel configuration used to set the client valid certificates and server certificate
This is a server configuration -->
<devage.serviceModel>
<!-- List of service type each with the relative server certificate and client certificate list -->
<services>
<add name="MathService"
serverCertificate="App_Data\Server.pfx"
clientCertificates="App_Data\Client1.cer, App_Data\Client2.cer"
/>
</services>
</devage.serviceModel>
<!-- Specific DevAge.ServiceModel configuration used to set the client certificate
This is a client configuration -->
<devage.serviceModel>
<!-- List of endPoints each with the relative client certificate to use for authentication -->
<endPoints>
<add contract="IMathService"
clientCertificate="Client.pfx"
/>
</endPoints>
</devage.serviceModel>
* */
/// <summary>
/// The DevAge.ServiceModel conficuration section handler.
/// Contains the list of certificates files to use.
/// </summary>
public class Section : ConfigurationSection
{
public static Section GetSection()
{
Section section =
(Section)ConfigurationManager.GetSection("devage.serviceModel");
return section;
}
[ConfigurationProperty("services")]
public ServiceCollection Services
{
get { return this["services"] as ServiceCollection; }
}
[ConfigurationProperty("endPoints")]
public EndPointCollection EndPoints
{
get { return this["endPoints"] as EndPointCollection; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.