2009-06-29 11 views
0

私はADAMのセットアップを持っている&私はなど、新規ユーザーの追加などの管理タスクを完了するためにウェブサービスを書いている(私は同じADAMインスタンスを利用し、複数のアプリケーションを持っている)ADAM - アプリケーション固有の属性を「格納」する方法はありますか?

私はおそらく鳴りを達成しようとしています少し奇妙ですが、基本的には管理者ユーザーがWebサービスがADAMから返す属性を選択できるようにしたいと考えています。例えば。アプリケーション1はdisplayName & telephoneNumberを返しますが、アプリケーション2は返される属性と同じ属性を必要としないことがあります。

現在、ユーザーが選択した属性を格納するためにSQL Serverテーブルを設定しました。& Webサービスでこれをループし、必要な属性を読み込んで結果を配列に返します(Ifあなたの興味があるのは、コードを最後に追加します)。

これを行うより良い方法があるかどうかを知りたかったですか?このようなものをADAM自体に保存することは可能ですか?

ありがとうございました!

//using linq to access table 
DataClasses1DataContext db = new DataClasses1DataContext(); 

var queryAttributes = from atr in db.AttributesToReturns 
         where atr.appNumber == appNumber 
         select atr; 

ArrayList userD = new ArrayList(); 
foreach (var a in queryAttributes) 
{ 
     //the col 'attribute' contains the exact name in active direct e.g. displayName 
     string att = a.attribute.ToString(); 
     searcher.PropertiesToLoad.Add(att); 
    } 

//--code omitted but here perform search & get req Directory Entry 
foreach (var a in queryAttributes) 
{ 
     string attributeName = a.attribute.ToString(); 

     try 
    { 
      string value = user.Properties[attributeName].Value.ToString(); 
      //do something with value - here i am updating a user object which will be added to the ArrayList the webservice is returning 
      updateUser(u, attributeName, value); 
    } 
     //if an error - just set value to empty 
     catch (Exception ex) 
     { 
      string value = "NULL"; 
      updateUser(u, attributeName, value); 
     } 


    } 
     userD.Add(u); 
+0

男を動作するはずを拡張することができが、明らかにこれは私で特異的に結局:( –

答えて

2
+0

なるほどそうに向けられていませんあなたは複数の文字列を格納する属性を作成し、そこに返す属性を追加することを意味しますか?ありがとうございます:) – samcooper11

+0

既存のオブジェクトクラスのスキーマを拡張できますが、 。 –

+0

また、LDFファイルを保存すると、必要に応じて他のLDAPシステム(OpenLDAP、Active Directory、eDirectoryなど)を拡張できます。 –

関連する問題