Class ServiceModelConfigurator
Provides helper methods for creating configured Service Model entities from their corresponding configuration elements.
Inheritance
Inherited Members
Namespace: Nevatech.Vsb.Repository.Configuration
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class ServiceModelConfigurator
Constructors
ServiceModelConfigurator(Configuration)
Initializes new instance with provided application configuration.
Declaration
public ServiceModelConfigurator(Configuration configuration)
Parameters
Type | Name | Description |
---|---|---|
System.Configuration.Configuration | configuration | Application configuration containing Service Model configuration elements. |
Methods
FindChannelEndpointElement(String)
Returns System.ServiceModel.Configuration.ChannelEndpointElement corresponding to provided client endpoint name.
Declaration
public ChannelEndpointElement FindChannelEndpointElement(string endpointName)
Parameters
Type | Name | Description |
---|---|---|
System.String | endpointName | Name of the client endpoint in configuration file. |
Returns
Type | Description |
---|---|
System.ServiceModel.Configuration.ChannelEndpointElement | Configured System.ServiceModel.Configuration.ChannelEndpointElement instance, if endpoint is found, or null, if not found. |
GetBinding(String, String)
Creates and configures specified binding and applies provided binding configuration to it.
Declaration
public Binding GetBinding(string bindingName, string bindingConfigurationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | bindingName | Binding type name that needs to be created (like 'wsHttpBinding'). |
System.String | bindingConfigurationName | Binding configuration name that needs to be applied to created binding. |
Returns
Type | Description |
---|---|
System.ServiceModel.Channels.Binding | Configured binding. |
GetClientEndpoint(String, Type)
Creates and configures client endpoint from configuration element with the specified name.
Declaration
public ServiceEndpoint GetClientEndpoint(string endpointName, Type contractType)
Parameters
Type | Name | Description |
---|---|---|
System.String | endpointName | Name of the client endpoint in configuration file. |
System.Type | contractType | Contract type of the client endpoint. If not provided, type will be instantiated using endpoint configuration. |
Returns
Type | Description |
---|---|
System.ServiceModel.Description.ServiceEndpoint | Initialized endpoint. |
GetEndpointBehaviors(String)
Returns collection of configured endpoint behaviors listed under the specified configuration name.
Declaration
public KeyedByTypeCollection<IEndpointBehavior> GetEndpointBehaviors(string behaviorConfigurationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | behaviorConfigurationName | Endpoint behavior configuration name. |
Returns
Type | Description |
---|---|
System.Collections.Generic.KeyedByTypeCollection<System.ServiceModel.Description.IEndpointBehavior> | Collection of configured endpoint behaviors listed under the specified configuration name. |
GetServiceBehaviors(String)
Returns collection of configured service behaviors listed under the specified configuration name.
Declaration
public KeyedByTypeCollection<IServiceBehavior> GetServiceBehaviors(string behaviorConfigurationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | behaviorConfigurationName | Service behavior configuration name. |
Returns
Type | Description |
---|---|
System.Collections.Generic.KeyedByTypeCollection<System.ServiceModel.Description.IServiceBehavior> | Collection of configured service behaviors listed under the specified configuration name. |
GetServiceEndpoint(String, String, Type)
Creates and configures service endpoint belonging to the specified service and having the specified name.
Declaration
public ServiceEndpoint GetServiceEndpoint(string serviceName, string endpointName, Type contractType)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceName | Name of the service in configuration file. |
System.String | endpointName | Name of the service endpoint in configuration file. |
System.Type | contractType | Contract type of the service endpoint. If not provided, type will be instantiated using endpoint configuration. |
Returns
Type | Description |
---|---|
System.ServiceModel.Description.ServiceEndpoint | Initialized endpoint. |
GetServiceEndpoints(String, Type)
Creates and configures all endpoints belonging to the specified service.
Declaration
public Collection<ServiceEndpoint> GetServiceEndpoints(string serviceName, Type contractType)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceName | Name of the service in configuration file. |
System.Type | contractType | Contract type that all endpoints should have. If not provided, type will be instantiated using endpoint configuration. |
Returns
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<System.ServiceModel.Description.ServiceEndpoint> | Collection of initialized service endpoints. |