Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-1267

GcGetSubjects returns only the first value of a multi-valued attribute

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 2.2.2
    • grouperClient
    • None
    • Grouper 2.2.2

    Description

      I would to retrieve a multi-valued attribute calling a grouper web service using the GrouperClient API.

      I'm doing this:

      WsSubjectLookup sl = new WsSubjectLookup();
      sl.setSubjectId("myuserid");
       
      GcGetSubjects gs = new GcGetSubjects()
                      .addWsSubjectLookup(sl)
                      .addSubjectAttributeName("myattribute");
       
      WsGetSubjectsResults results = gs.execute();
      WsSubject[] subjects = results.getWsSubjects();
      for(String value : subjects[0].getAttributeValues()) {
         // Only the first value of the multi-valued attribute is retrieved
         // I know that the array should have one entry for each different attribute name,
         // but I'm expecting here to have at least a string with a list of a comma separated values,
         // as happen in the Grouper UI admin panel.
      }
      

      Instead if I use the LDAP search all works correctly:

      GcLdapSearchAttribute ls = new GcLdapSearchAttribute()
                      .assignLdapName("...")
                      .addMatchingAttribute("uid", "myuserid")
                      .addReturningAttribute("myattribute");
      ls.execute();
      ls.retrieveResultAttributeStringList(); // <-- This works!
      

      Thanks for your help!

      Attachments

        Activity

          People

            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            xonya Sonia Zorba (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: