Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] Errors on WS get attribute assignments

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] Errors on WS get attribute assignments


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Keith Hazelton <>, "" <>
  • Subject: RE: [grouper-users] Errors on WS get attribute assignments
  • Date: Thu, 12 Jul 2012 13:21:58 +0000
  • Accept-language: en-US

It works for me... are you using the display name or the system name?  You must use the system name for WS calls:


C:\mchyzer\grouper\v2_1\grouperClient\dist>java -jar grouperClient.jar --operation=getAttributeAssig
nmentsWs --attributeAssignType=group --includeAssignmentsOnAssignments=T --attributeDefNameNames=bam
boo:GeoSpatialApps:appId --debug=true
DEBUG: Reading resource: grouper.client.properties, from: C:\mchyzer\grouper\v2_1\grouperClient\dist
\grouper.client.properties
DEBUG: method: DiscoveryClient.retrieveFile, configuredToUseDiscovery: false
DEBUG: method: FailoverClient.instanceMapFromType, read failover state from file: C:\mchyzer\grouper
\v2_1\grouperClient\dist\grouperClientFailoverState.bin, success: true, failoverClient discoveryClie
nt hash: e102dc, failoverClient discoveryClient cache hash: 82c01f, failoverClient discoveryClient a
ffinity: null, failoverClient grouperWsReadOnly hash: 133796, failoverClient grouperWsReadOnly cache
 hash: 1a679b7, failoverClient grouperWsReadOnly affinity: null, failoverClient grouperWsReadWrite h
ash: 80f4cb, failoverClient grouperWsReadWrite cache hash: 4741d6, failoverClient grouperWsReadWrite
 affinity: null
DEBUG: method: GrouperClientWs.configureFailoverClient, needsReconfigure: true, discoveryFile: not c
onfigured to use, needsReconfigureFile: true, affinitySeconds: 28800, extraTimeoutSeconds: 30, error
sForMinutes: 3, failoverStrategy: activeActive, preferReadWrite: true, timeoutSeconds: 60
DEBUG: WebService: connecting as user: 'GrouperSystem'
DEBUG: WebService: connecting to URL: 'http://localhost:8091/grouper-ws/servicesRest/v2_1_001/attrib
uteAssignments'

################ REQUEST START (indented) ###############

POST /grouper-ws/servicesRest/v2_1_001/attributeAssignments HTTP/1.1
Connection: close
Authorization: Basic xxxxxxxxxxxxxxxx
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8091
Content-Length: 341
Content-Type: text/xml; charset=UTF-8

<WsRestGetAttributeAssignmentsRequest>
  <attributeAssignType>group</attributeAssignType>
  <wsAttributeDefNameLookups>
    <WsAttributeDefNameLookup>
      <name>bamboo:GeoSpatialApps:appId</name>
    </WsAttributeDefNameLookup>
  </wsAttributeDefNameLookups>
  <includeAssignmentsOnAssignments>T</includeAssignmentsOnAssignments>
</WsRestGetAttributeAssignmentsRequest>

################ REQUEST END ###############



################ RESPONSE START (indented) ###############

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=xxxxxxxxxxxx; Path=/grouper-ws
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE
Content-Type: text/xml;charset=UTF-8
Date: Thu, 12 Jul 2012 13:19:05 GMT
Connection: close

<WsGetAttributeAssignmentsResults>
  <wsAttributeDefs>
    <WsAttributeDef>
      <extension>attributeDefs</extension>
      <name>bamboo:GeoSpatialApps:attributeDefs</name>
      <uuid>00b0f3eba0634070950caacdc9f6e8f6</uuid>
      <attributeDefType>attr</attributeDefType>
      <multiAssignable>F</multiAssignable>
      <multiValued>F</multiValued>
      <valueType>string</valueType>
    </WsAttributeDef>
  </wsAttributeDefs>
  <wsAttributeDefNames>
    <WsAttributeDefName>
      <extension>appId</extension>
      <displayExtension>appId</displayExtension>
      <displayName>bamboo:GeoSpatialApps:appId</displayName>
      <name>bamboo:GeoSpatialApps:appId</name>
      <uuid>2382a9087b3343b397b3d3e4fddc3368</uuid>
      <attributeDefId>00b0f3eba0634070950caacdc9f6e8f6</attributeDefId>
      <attributeDefName>bamboo:GeoSpatialApps:attributeDefs</attributeDefName>
    </WsAttributeDefName>
  </wsAttributeDefNames>
  <wsAttributeAssigns>
    <WsAttributeAssign>
      <disallowed>F</disallowed>
      <attributeAssignActionType>immediate</attributeAssignActionType>
      <attributeAssignDelegatable>FALSE</attributeAssignDelegatable>
      <attributeAssignActionId>4637ce3f51b041f4bcdaace25a6605f1</attributeAssignActionId>
      <attributeAssignActionName>assign</attributeAssignActionName>
      <attributeAssignType>group</attributeAssignType>
      <attributeDefNameId>2382a9087b3343b397b3d3e4fddc3368</attributeDefNameId>
      <attributeDefNameName>bamboo:GeoSpatialApps:appId</attributeDefNameName>
      <attributeDefId>00b0f3eba0634070950caacdc9f6e8f6</attributeDefId>
      <attributeDefName>bamboo:GeoSpatialApps:attributeDefs</attributeDefName>
      <createdOn>2012/07/12 09:12:54.120</createdOn>
      <enabled>T</enabled>
      <id>e24e126b3f9344b2bab8c11c438346b8</id>
      <lastUpdated>2012/07/12 09:12:54.120</lastUpdated>
      <ownerGroupId>d987f02d564044ea9c816dadf5de8820</ownerGroupId>
      <ownerGroupName>bamboo:someGroup</ownerGroupName>
    </WsAttributeAssign>
  </wsAttributeAssigns>
  <resultMetadata>
    <resultCode>SUCCESS</resultCode>
    <resultMessage>, Found 1 results.  </resultMessage>
    <success>T</success>
  </resultMetadata>
  <responseMetadata>
    <resultWarnings></resultWarnings>
    <millis>1309</millis>
    <serverVersion>2.1.1</serverVersion>
  </responseMetadata>
  <wsGroups>
    <WsGroup>
      <extension>someGroup</extension>
      <typeOfGroup>group</typeOfGroup>
      <displayExtension>someGroup</displayExtension>
      <displayName>bamboo:someGroup</displayName>
      <name>bamboo:someGroup</name>
      <uuid>d987f02d564044ea9c816dadf5de8820</uuid>
    </WsGroup>
  </wsGroups>
  <wsStems/>
  <wsMemberships/>
  <wsSubjects/>
</WsGetAttributeAssignmentsResults>

################ RESPONSE END ###############


DEBUG: method: FailoverClient.internal_failoverLogic, type: grouperWsReadOnly, connections: 1, Not l
oad balancing: connection type: grouperWsReadOnly, name: http://localhost:8091/grouper-ws/servicesRe
st
DEBUG: method: FailoverClient.failoverLogic, saveStateEverySeconds: 60
DEBUG: Output template: Index: ${index}: attributeAssignType: ${wsAttributeAssign.attributeAssignTyp
e}, owner: ${ownerName}, attributeDefNameName: ${wsAttributeDefName.name}, action: ${wsAttributeAssi
gn.attributeAssignActionName}, values: ${valuesString}, enabled: ${wsAttributeAssign.enabled}, id: $
{wsAttributeAssign.id}, available variables: wsGetAttributeAssignmentsResults, grouperClientUtils, i
ndex, wsAttributeAssignment
Index: 0: attributeAssignType: group, owner: bamboo:someGroup, attributeDefNameName: bamboo:GeoSpati
alApps:appId, action: assign, values: none, enabled: T, id: e24e126b3f9344b2bab8c11c438346b8
DEBUG: Elapsed time: 4099ms

C:\mchyzer\grouper\v2_1\grouperClient\dist>




From: [] on behalf of Keith Hazelton []
Sent: Thursday, July 12, 2012 8:39 AM
To:
Subject: [grouper-users] Errors on WS get attribute assignments

I'm now trying to retrieve attribute/value pairs assigned to a Grouper local entity via REST.  I'm basing it on the sample code at:

linked from 

Using Firefox Poster to make the call

Passing in text/xml:
<WsRestGetAttributeAssignmentsRequest>
  <attributeAssignType>group</attributeAssignType>
  <wsAttributeDefNameLookups>
    <WsAttributeDefNameLookup>
      <uuid></uuid>
      <name>Bamboo:Geo-Spatial Apps:App Id</name>
    </WsAttributeDefNameLookup>
  </wsAttributeDefNameLookups>
  <includeAssignmentsOnAssignments>T</includeAssignmentsOnAssignments>
</WsRestGetAttributeAssignmentsRequest>

...and getting an exception:
-----
<WsGetAttributeAssignmentsResults><resultMetadata><resultCode>EXCEPTION</resultCode><resultMessage>clientVersion: 2.1.0, attributeAssignType: group, wsAttributeDefLookups: null, wsAttributeAssignLookups: null, wsAttributeDefNameLookups: Array size: 1: [0]: WsAttributeDefNameLookup[uuid=,name=Bamboo:Geo-Spatial Apps:App Id]
, wsOwnerStemLookups: null, wsOwnerGroupLookups: null, wsOwnerMembershipLookups: null, wsOwnerMembershipAnyLookups: null, wsOwnerAttributeDefLookups: null, actions: null, includeSubjectDetail: false, actAsSubject: null, subjectAttributeNames: null
, paramNames: 
, params: null
, wsOwnerSubjectLookups: null, enabled: null, java.lang.RuntimeException: Illegal query, you need to pass in attributeAssignIds and/or attributeDefId(s) and/or groupId(s) and/or groupNames and/or attributeDefNameIds
at edu.internet2.middleware.grouper.internal.dao.hib3.Hib3AttributeAssignDAO.findGroupAttributeAssignments(Hib3AttributeAssignDAO.java:751)
...
...
-----

If my local entity owner group is Voronoi Generator
and the attribute def that contains the various attribute names is bamboo:GeoSpatialApps:attributeDefs

what additional parameter do I need to put in the request?  Probably the groupId for the owner group?  What would that look like?

           Advice welcome,    --Keith



Archive powered by MHonArc 2.6.16.

Top of Page