public virtual Binding Create(
string uriScheme,
List<EndpointDescription> descriptions,
EndpointConfiguration configuration)
{
if (uriScheme == null) throw new ArgumentNullException("uriScheme");
Type bindingType = null;
if (!m_bindings.TryGetValue(uriScheme, out bindingType))
{
throw ServiceResultException.Create(StatusCodes.BadInvalidArgument, "Could not find binding type for scheme: '{0}'.", uriScheme);
}
try
{
return (Binding)Activator.CreateInstance(bindingType, m_namespaceUris, m_factory, configuration, descriptions.ToArray());
}
catch (Exception e)
{
throw ServiceResultException.Create(StatusCodes.BadInvalidArgument, e, "An session binding for type '{0}' could not be created from the EndpointDescription and the EndpointConfiguration.", bindingType.FullName);
}
}