我正在进行自定义WCF身份验证和授权,并找到一些关于UserNamePasswordValidator和ServiceAuthorizationManager的文章.
我还发现了使用自定义System.ServiceModel的线索.ServiceAuthenticationManager(死链接 ),但msdn并没有详细说明它(http://msdn.microsoft.com/en-us/library/system.servicemodel.serviceauthenticationmanager.aspx).
所以我在这里:任何人都更了解ServiceAuthenticationManager?
通常,您将如何设置自定义WCF身份验证?
我正在为WCF问题创建一个基于现有接口的接口,但是我没有设置参数名称的"DefineParameter"(创建类型的方法参数没有名称).
你能看出原因吗?
public static Type MakeWcfInterface(Type iService)
{
AssemblyName assemblyName = new AssemblyName(String.Format("{0}_DynamicWcf", iService.FullName));
String moduleName = String.Format("{0}.dll", assemblyName.Name);
String ns = iService.Namespace;
if (!String.IsNullOrEmpty(ns)) ns += ".";
// Create assembly
var assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave);
// Create module
var module = assembly.DefineDynamicModule(moduleName, false);
// Create asynchronous interface type
TypeBuilder iWcfService = module.DefineType(
String.Format("{0}DynamicWcf", iService.FullName),
TypeAttributes.Public | TypeAttributes.Interface | TypeAttributes.Abstract
);
// Set ServiceContract attributes
iWcfService.SetCustomAttribute(ReflectionEmitHelper.BuildAttribute<ServiceContractAttribute>(null,
new Dictionary<string, object>() {
{ "Name", iService.Name },
}));
iWcfService.SetCustomAttribute(ReflectionEmitHelper.BuildAttribute<ServiceBehaviorAttribute>(null,
new Dictionary<string, object>() { …Run Code Online (Sandbox Code Playgroud)