Using client classes in code

 

using cz.uhul.DSMLv2;
using cz.uhul.DSMLv2.client;

LdConnection conn = LdConnection.CreateConnection(
  new Uri("https://myserver.com/LDS/")
);
//set credentials...
conn.ClientCredentials.UserName.UserName = "admin";
conn.ClientCredentials.UserName.Password = "-------------";

LdRequestDocument rd = new LdRequestDocument()
{
  DocumentProcessing = LdDocumentProcessing.Parallel
  ,ResponseOrder = LdResponseOrderEnum.Unordered //mandatory in currend ver. !!!!
  ,AddRequests = new LdRequestsCollection()
  {
    new LdAddRequest()
    {
      DistinguishedName="CN=Alice,OU=HR,DC=Example,DC=COM"
      ,Attributes = new LdAttrCollection()
      {
        new LdAttr()
        {
          Name = "objectClass"
          ,Values = new ObservableCollection<string>()
          {
            "orgEmploye"
          }
        }
        ,new LdAttr()
        {
          Name = "uid"
          ,Values = new ObservableCollection<string>()
          {
            "alice"
          }
        }
      }
    }
  }
};

LdResponseDocument respd = conn.SendRequest(rd);

Last edited Aug 17, 2013 at 9:06 AM by asida, version 2

Comments

No comments yet.