public virtual Binding Create(
string uriScheme,
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, (EndpointDescription)null);
}
catch (Exception e)
{
throw ServiceResultException.Create(StatusCodes.BadInvalidArgument, e, "A dicovery binding for type '{0}' could not be created from the EndpointConfiguration.", bindingType.FullName);
}
}