Skip to Content.
Sympa Menu

grouper-dev - [grouper-dev] RE: more WS problems

Subject: Grouper Developers Forum

List archive

[grouper-dev] RE: more WS problems


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Scott Koranda <>
  • Cc: Grouper Dev <>
  • Subject: [grouper-dev] RE: more WS problems
  • Date: Wed, 18 Apr 2012 12:39:18 +0000
  • Accept-language: en-US

no problem. here are the client calls and the JSON. Thanks, Chris

Add member request:

PUT /grouper-ws/servicesRest/v2_1_001/groups

{
"WsRestAddMemberRequest":{
"subjectLookups":[
{
"subjectId":"test.subject.0",
"subjectSourceId":"jdbc"
}
],
"wsGroupLookup":{
"groupName":"test:testGroup"
}
}
}

Add member response:

{
"WsAddMemberResults":{
"responseMetadata":{
"millis":"112",
"serverVersion":"2.1.1"
},
"resultMetadata":{
"resultCode":"SUCCESS",
"resultMessage":"Success for: clientVersion: 2.1.1, wsGroupLookup:
WsGroupLookup[pitGroups=[],groupName=test:testGroup], subjectLookups: Array
size: 1: [0]:
WsSubjectLookup[subjectId=test.subject.0,subjectSourceId=jdbc]\n\n,
replaceAllExisting: false, actAsSubject: null, fieldName: null, txType: NONE,
includeGroupDetail: false, includeSubjectDetail: false,
subjectAttributeNames: null\n, params: null\n, disabledDate: null,
enabledDate: null",
"success":"T"
},
"results":[
{
"resultMetadata":{
"resultCode":"SUCCESS_ALREADY_EXISTED",
"success":"T"
},
"wsSubject":{
"id":"test.subject.0",
"name":"my name is test.subject.0",
"resultCode":"SUCCESS",
"sourceId":"jdbc",
"success":"T"
}
}
],
"wsGroupAssigned":{
"displayExtension":"testGroup",
"displayName":"test:testGroup",
"extension":"testGroup",
"name":"test:testGroup",
"typeOfGroup":"group",
"uuid":"6c823ca1134545ae8a2885d20ab45506"
}
}
}

#############################
Get the membership ID

Request:

PUT /grouper-ws/servicesRest/v2_1_001/groups

{
"WsRestGetMembershipsRequest":{
"fieldName":"members",
"memberFilter":"Immediate",
"wsGroupLookups":[
{
"groupName":"test:testGroup"
}
],
"wsSubjectLookups":[
{
"subjectId":"test.subject.0",
"subjectSourceId":"jdbc"
}
]
}
}

Response:

{
"WsGetMembershipsResults":{
"responseMetadata":{
"millis":"276",
"serverVersion":"2.1.1"
},
"resultMetadata":{
"resultCode":"SUCCESS",
"resultMessage":"Found 1 results involving 1 groups and 1 subjects",
"success":"T"
},
"wsGroups":[
{
"displayExtension":"testGroup",
"displayName":"test:testGroup",
"extension":"testGroup",
"name":"test:testGroup",
"typeOfGroup":"group",
"uuid":"6c823ca1134545ae8a2885d20ab45506"
}
],
"wsMemberships":[
{
"createTime":"2012/04/18 08:09:40.870",
"enabled":"T",
"groupId":"6c823ca1134545ae8a2885d20ab45506",
"groupName":"test:testGroup",
"immediateMembershipId":"b74074ca8e81429fbb366bb254bb55e8",
"listName":"members",
"listType":"list",
"memberId":"42c245f644014c5d8b3e5f38a5ebcbd6",

"membershipId":"b74074ca8e81429fbb366bb254bb55e8:4f2b814618e6411dbabf2528e03f985e",
"membershipType":"immediate",
"subjectId":"test.subject.0",
"subjectSourceId":"jdbc"
}
],
"wsSubjects":[
{
"id":"test.subject.0",
"resultCode":"SUCCESS",
"sourceId":"jdbc",
"success":"T"
}
]
}
}

##############################
Assign an attribute and id

Request:

PUT /grouper-ws/servicesRest/v2_1_001/attributeAssignments

{
"WsRestAssignAttributesRequest":{
"attributeAssignOperation":"assign_attr",
"attributeAssignType":"imm_mem",
"attributeAssignValueOperation":"add_value",
"values":[
{
"valueSystem":"some_value"
}
],
"wsAttributeDefNameLookups":[
{
"name":"test:testAttrName"
}
],
"wsOwnerMembershipLookups":[
{
"uuid":"b74074ca8e81429fbb366bb254bb55e8"
}
]
}
}

Response:

{
"WsAssignAttributesResults":{
"responseMetadata":{
"millis":"516",
"serverVersion":"2.1.1"
},
"resultMetadata":{
"resultCode":"SUCCESS",
"resultMessage":", Found 1 results.",
"success":"T"
},
"wsAttributeAssignResults":[
{
"changed":"T",
"deleted":"F",
"valuesChanged":"T",
"wsAttributeAssignValueResults":[
{
"changed":"T",
"deleted":"F",
"wsAttributeAssignValue":{
"id":"81249868c40940ce8f5d38282545285d",
"valueSystem":"some_value"
}
}
],
"wsAttributeAssigns":[
{

"attributeAssignActionId":"4160134c44314f78b5c103a4f516298d",
"attributeAssignActionName":"assign",
"attributeAssignActionType":"immediate",
"attributeAssignDelegatable":"FALSE",
"attributeAssignType":"imm_mem",
"attributeDefId":"acec0291c7344e06bfefab9a557c3c1d",
"attributeDefName":"test:testAttrDef",
"attributeDefNameId":"809ce81034f6412da72fa8c75d00e7a2",
"attributeDefNameName":"test:testAttrName",
"createdOn":"2012/04/18 08:33:01.009",
"disallowed":"F",
"enabled":"T",
"id":"005df86f5b19477d95b33db893c72c96",
"lastUpdated":"2012/04/18 08:33:01.009",
"ownerMembershipId":"b74074ca8e81429fbb366bb254bb55e8",
"wsAttributeAssignValues":[
{
"id":"81249868c40940ce8f5d38282545285d",
"valueSystem":"some_value"
}
]
}
]
}
],
"wsAttributeDefNames":[
{
"attributeDefId":"acec0291c7344e06bfefab9a557c3c1d",
"attributeDefName":"test:testAttrDef",
"displayExtension":"testAttrName",
"displayName":"test:testAttrName",
"extension":"testAttrName",
"name":"test:testAttrName",
"uuid":"809ce81034f6412da72fa8c75d00e7a2"
}
],
"wsAttributeDefs":[
{
"attributeDefType":"attr",
"extension":"testAttrDef",
"multiAssignable":"F",
"multiValued":"F",
"name":"test:testAttrDef",
"uuid":"acec0291c7344e06bfefab9a557c3c1d",
"valueType":"string"
}
],
"wsGroups":[

],
"wsMemberships":[
{
"createTime":"2012/04/18 08:09:40.870",
"enabled":"T",
"groupId":"6c823ca1134545ae8a2885d20ab45506",
"groupName":"test:testGroup",
"immediateMembershipId":"b74074ca8e81429fbb366bb254bb55e8",
"listName":"members",
"listType":"list",
"memberId":"42c245f644014c5d8b3e5f38a5ebcbd6",

"membershipId":"b74074ca8e81429fbb366bb254bb55e8:4f2b814618e6411dbabf2528e03f985e",
"membershipType":"immediate",
"subjectId":"test.subject.0",
"subjectSourceId":"jdbc"
}
],
"wsStems":[

],
"wsSubjects":[

]
}
}

________________________________________
From: Scott Koranda
[]
Sent: Tuesday, April 17, 2012 7:42 PM
To: Chris Hyzer
Subject: more WS problems

Hi Chris,

I am still struggling with WS calls involving attributes. I
would be grateful if you could explain the following to me.

Suppose I already have the Group 'Astem:Agroup' defined and it
is empty.

I also have the Subject
''
available.
Lastly I have defined the attribute 'my_attribute' as a string
that can be set on immediate memberships.

What WS calls do I make and what JSON do I send in to do the
following:

1) add
''
to 'Astem:Agroup'

2) on that immediate membership just created assign the
attribute 'my_attribute' with value 'foo'

?

I appreciate any help you can give me.

Thanks,

Scott



Archive powered by MHonArc 2.6.16.

Top of Page