//static IFormatter GetEncoder(WADLParam param) //{ // Type type = Type.GetType(TemplateConfigurationHandler.GetConfiguration().Encoders[param.Encoding].Type); // return (IFormatter)Activator.CreateInstance(type); //} static void Encode(Stream stream, WADLRepresentation param, object value) { TemplateConfigurationHandler handler = TemplateConfigurationHandler.GetConfiguration(); var encoderCnfg = handler.Encoders[param.ContentType]; if (!String.IsNullOrEmpty(encoderCnfg.Type)) { Type encoder = Type.GetType(encoderCnfg.Type); INetHttpEncoder formatter = Activator.CreateInstance(encoder) as INetHttpEncoder; formatter.Encode(stream, param, value); } }