Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] finding privileges on groups via WS interface

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] finding privileges on groups via WS interface


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Martin van Es <>, Grouper Users Mailing List <>
  • Subject: RE: [grouper-users] finding privileges on groups via WS interface
  • Date: Thu, 5 Mar 2009 01:38:15 -0500
  • Accept-language: en-US
  • Acceptlanguage: en-US

This is that same Axis problem we discussed a few weeks ago. This is very
annoying. The only way I could get it to work is to pass an empty string in
the array of size 1 or subject attribute names... yikes.

https://issues.apache.org/jira/browse/AXIS2-3364

Note: the bug says its target is Axis2 1.5, which I think is in or passed
beta2... we should get a copy of it in grouperWs and see if it is fixed...

I added some samples about this call, which once propagated to anonymous CVS
will show the inputs/outputs in rest/soap/lite/etc (should be in an hour or
two)

Attached is the SOAP sample. Here are the others (the ones with "admin" in
the name):

http://viewvc.internet2.edu/viewvc.py/grouper-ws/grouper-ws/doc/samples/getGroups/?root=I2MI

Note, as in your email, you can see if it is processed correctly (see it
returned with description that says there was a paramName and value, and the
field of admins:

<ns:resultMessage>Success for: clientVersion: v1_4_002,
subjectLookups: Array size: 2: [0]: WsSubjectLookup[subjectId=GrouperSystem]
[1]: WsSubjectLookup[subjectId=10021368]

memberFilter: All, includeGroupDetail: false, actAsSubject:
WsSubjectLookup[subjectId=GrouperSystem]
, params: Array size: 1: [0]: WsParam[paramName=fieldName,paramValue=admins]
, field: admins</ns:resultMessage>

Regards,
Chris

Ps. I don't know if it is necessary, it seemed to work without it, but I did
commit a change to grouper-ws branch 1.4 so that if one empty string subject
attribute is sent, it will toss it out...

> -----Original Message-----
> From: Martin van Es
> [mailto:]
> Sent: Wednesday, March 04, 2009 4:05 PM
> To: Chris Hyzer; Grouper Users Mailing List
> Subject: Re: [grouper-users] finding privileges on groups via WS
> interface
>
> Hi Chris,
>
> I'm trying the new params in getGroups to collect all groups for which
> the
> supplied subject is admin using the following SOAP request:
>
> <ns1:getGroups>
> <ns1:clientVersion>v1_4_000</ns1:clientVersion>
> <ns1:subjectLookups>
> <ns1:subjectId>SURFnetShowcase.joe</ns1:subjectId>
> </ns1:subjectLookups>
> <ns1:memberFilter></ns1:memberFilter>
> <ns1:includeGroupDetail>true</ns1:includeGroupDetail>
> <ns1:includeSubjectDetail>false</ns1:includeSubjectDetail>
> <ns1:subjectAttributeNames></ns1:subjectAttributeNames>
> <ns1:params>
> <ns1:paramName>fieldName</ns1:paramName>
> <ns1:paramValue>admins</ns1:paramValue>
> </ns1:params>
> </ns1:getGroups>
>
> But the answer contains no valid groups (and I'm very sure
> SURFnetShowcase.joe
> is admin for at least one group). The thing that worries me is the
> params part
> in the resultMessage:
>
> Success for: clientVersion: v1_4_000, subjectLookups: Array size: 1:
> [0]:
> WsSubjectLookup[subjectId=SURFnetShowcase.joe]
> memberFilter: All, includeGroupDetail: false, actAsSubject:
> WsSubjectLookup[]
> , params: Empty array
>
>
> It says "params: Empty" array which it defenately isn't! What am I
> missing?
>
> Regards,
> Martin
>
>
> On Monday 23 February 2009 19:43:25 Chris Hyzer wrote:
> > I looked into it, and found out why I never added it to WS, because
> the
> > grouper API doesn't have a method for it. :)
> >
> > Anyways, I added it, feel free to get latest from the 1.4 branch, and
> try
> > it out. I need to do more testing before closing the bug, but the
> test I
> > did through a WS call worked fine.
> >
> > cvs
> > -d:pserver::/home/cvs/i2mi
> > login
> > cvs
> > -d:pserver::/home/cvs/i2mi
> > export -r
> > GROUPER_1_4_BRANCH grouper cvs
> > -d:pserver::/home/cvs/i2mi
> > export -r
> > GROUPER_1_4_BRANCH grouper-ws
> >
> > https://bugs.internet2.edu/jira/browse/GRP-232
> >
> > I added the API:
> >
> > gsh 0% subj = findSubject("10021368")
> > subject: id='10021368' type='person' source='pennperson' name='Chris
> Hyzer'
> > gsh 1% sess = GrouperSession.start(subj)
> > edu.internet2.middleware.grouper.GrouperSession:
> > 8d17a97d-3d1a-4e39-a44c-01a3fead792d,'10021368','person' gsh 2%
> member =
> > MemberFinder.findBySubject(sess, subj)
> > member: id='10021368' type='person' source='pennperson'
> > uuid='6512f26a-98b5-486c-bc94-ac26e0d9a7ca' gsh 3% field =
> > FieldFinder.find("admins")
> > access privilege: 'admins'
> > gsh 4% member.getGroups(field);
> > group: name='aStem:whateverGroup2' displayName='aStem:disp2'
> > uuid='b3be109a-afb6-49d0-8aaf-73cbd130f967' group:
> name='aStem:aGroup'
> > displayName='aStem:aGroup' uuid='4992b987-3329-418e-ba83-
> 9d9335305902'
> > group: name='aStem:whateverGroup' displayName='aStem:disp1'
> > uuid='2703916b-ac8a-4830-9a60-698a3b1faf97' gsh 5%
> >
> > Then I added a param on the getGroups web services (all flavors,
> though
> > here is an example in rest batch):
> >
> > <WsRestGetGroupsRequest>
> > <subjectLookups>
> > <WsSubjectLookup>
> > <subjectId>10021368</subjectId>
> > </WsSubjectLookup>
> > <WsSubjectLookup>
> > <subjectId>10039438</subjectId>
> > </WsSubjectLookup>
> > </subjectLookups>
> > <actAsSubjectLookup>
> > <subjectId>GrouperSystem</subjectId>
> > </actAsSubjectLookup>
> > <params>
> > <WsParam>
> > <paramName>fieldName</paramName>
> > <paramValue>admins</paramValue>
> > </WsParam>
> > </params>
> > </WsRestGetGroupsRequest>
> >
> > This will result in the following response (which looks like the
> normal
> > response, with the exception of the description):
> >
> > <WsGetGroupsResults>
> > <results>
> > <WsGetGroupsResult>
> > <wsGroups>
> > <WsGroup>
> > <extension>whateverGroup2</extension>
> > <displayExtension>disp2</displayExtension>
> > <description>descs</description>
> > <displayName>aStem:disp2</displayName>
> > <name>aStem:whateverGroup2</name>
> > <uuid>b3be109a-afb6-49d0-8aaf-73cbd130f967</uuid>
> > </WsGroup>
> > <WsGroup>
> > <extension>aGroup</extension>
> > <displayExtension>aGroup</displayExtension>
> > <displayName>aStem:aGroup</displayName>
> > <name>aStem:aGroup</name>
> > <uuid>4992b987-3329-418e-ba83-9d9335305902</uuid>
> > </WsGroup>
> > <WsGroup>
> > <extension>whateverGroup</extension>
> > <displayExtension>disp1</displayExtension>
> > <description>desc1</description>
> > <displayName>aStem:disp1</displayName>
> > <name>aStem:whateverGroup</name>
> > <uuid>2703916b-ac8a-4830-9a60-698a3b1faf97</uuid>
> > </WsGroup>
> > </wsGroups>
> > <resultMetadata>
> > <resultCode>SUCCESS</resultCode>
> > <success>T</success>
> > </resultMetadata>
> > <wsSubject>
> > <resultCode>SUCCESS</resultCode>
> > <success>T</success>
> > <id>10021368</id>
> > <sourceId>pennperson</sourceId>
> > </wsSubject>
> > </WsGetGroupsResult>
> > <WsGetGroupsResult>
> > <resultMetadata>
> > <resultCode>SUCCESS</resultCode>
> > <success>T</success>
> > </resultMetadata>
> > <wsSubject>
> > <resultCode>SUCCESS</resultCode>
> > <success>T</success>
> > <id>10039438</id>
> > <sourceId>pennperson</sourceId>
> > </wsSubject>
> > </WsGetGroupsResult>
> > </results>
> > <resultMetadata>
> > <resultCode>SUCCESS</resultCode>
> > <resultMessage>
> > Success for: clientVersion: v1_4_001, subjectLookups: Array
> size: 2:
> > [0]:
> >
> edu.internet2.middleware.grouper.ws.soap.WsSubjectLookup@14b2db7[subjec
> t=&l
> >t;null&gt;,member=&lt;null&gt;,cause=&lt;null&gt;,causeMember=&lt;null
> &gt;,s
> >ubjectFindResult=&lt;null&gt;,memberFindResult=&lt;null&gt;,su...
> > memberFilter: All, includeGroupDetail: false, actAsSubject:
> >
> >
> edu.internet2.middleware.grouper.ws.soap.WsSubjectLookup@6c9220[subject
> =&lt
> >;null&gt;,member=&lt;null&gt;,cause=&lt;null&gt;,causeMember=&lt;null&
> gt;,su
> >bjectFindResult=&lt;null&gt;,memberFindResult=&lt;null&gt;,subjectId=G
> rouper
> >System,subjectIdentifier=&lt;null&gt;,subjectSourceId=&lt;null&gt;] ,
> > params: Array size: 1: [0]:
> >
> >
> edu.internet2.middleware.grouper.ws.soap.WsParam@1ed7524[paramName=fiel
> dNam
> >e,..., field: admins
> > </resultMessage>
> > <success>T</success>
> > </resultMetadata>
> > <responseMetadata>
> > <millis>6437</millis>
> > <serverVersion>v1_4_002</serverVersion>
> > </responseMetadata>
> > </WsGetGroupsResults>
> >
> > Regards,
> > Chris
> >
> > > -----Original Message-----
> > > From: Scott Koranda
> > > [mailto:]
> > > Sent: Monday, February 23, 2009 12:16 PM
> > > To: Chris Hyzer
> > > Cc: Grouper Users Mailing List
> > > Subject: Re: [grouper-users] finding privileges on groups via WS
> > > interface
> > >
> > > Hi,
> > >
> > > > Doesn't look like it is possible. Should have been an
> > > > option in getGroups(), not sure if there was a reason it was
> > > > omitted. Anyways, when do you need it?
> > >
> > > I can work around it for now.
> > >
> > > Would it be possible for the 1.4.2 release or would it break
> > > backwards compatibility with 1.4.[0|1]?
> > >
> > > Or should it wait for 1.5?
> > >
> > > Cheers,
> > >
> > > Scott
> > >
> > > > Thanks, Chris
> > > >
> > > > > -----Original Message----- From: Scott Koranda
> > > > > [mailto:]
> > > > > Sent: Monday,
> > > > > February 23, 2009 11:01 AM To: Grouper Users Mailing List
> > > > > Subject: [grouper-users] finding privileges on groups via
> > > > > WS interface
> > > > >
> > > > > Hi,
> > > > >
> > > > > I learned recently that I can find all the subjects that
> > > > > have a privilege like 'UPDATE' on a group using the web
> > > > > services interface by invoking the getMembers operation
> > > > > and specifying the fieldName parameter as 'updaters'.
> > > > >
> > > > > Is there a WS operation that I can invoke to find all
> > > > > groups for which a particular subject has the 'UPDATE'
> > > > > privilege?
> > > > >
> > > > > Scott
Grouper web service sample of service: getGroups, WsSampleGetGroupsAdmins,
code generated classes, type: _admins, format: soap, for version: v1_4_002


#########################################
##
## HTTP request sample (could be formatted for view by
## indenting or changing dates or other data)
##
#########################################


POST /grouperWs/services/GrouperService HTTP/1.1
Content-Type: application/soap+xml; charset=UTF-8; action="urn:getGroups"
User-Agent: Axis2
Authorization: Basic xxxxxxxxxxxxxxxxx==
Host: localhost:8092
Transfer-Encoding: chunked

35f
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
<soapenv:Body>
<ns1:getGroups
xmlns:ns1="http://soap.ws.grouper.middleware.internet2.edu/xsd";>
<ns1:clientVersion>v1_4_002</ns1:clientVersion>
<ns1:subjectLookups>
<ns1:subjectId>GrouperSystem</ns1:subjectId>
</ns1:subjectLookups>
<ns1:subjectLookups>
<ns1:subjectId>10021368</ns1:subjectId>
</ns1:subjectLookups>
<ns1:memberFilter>All</ns1:memberFilter>
<ns1:actAsSubjectLookup>
<ns1:subjectId>GrouperSystem</ns1:subjectId>
</ns1:actAsSubjectLookup>
<ns1:includeGroupDetail>F</ns1:includeGroupDetail>
<ns1:includeSubjectDetail>F</ns1:includeSubjectDetail>
<ns1:subjectAttributeNames></ns1:subjectAttributeNames>
<ns1:params>
<ns1:paramName>fieldName</ns1:paramName>
<ns1:paramValue>admins</ns1:paramValue>
</ns1:params>
</ns1:getGroups>
</soapenv:Body>
</soapenv:Envelope>
0


#########################################
##
## HTTP response sample (could be formatted for view by
## indenting or changing dates or other data)
##
#########################################


HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=xxxxxxxxxxxxxxxxxxxxxxxx; Path=/grouperWs
X-Grouper-resultCode: SUCCESS
X-Grouper-success: T
X-Grouper-resultCode2: NONE
Content-Type: application/soap+xml;
action="urn:getGroupsResponse";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 05 Mar 2009 06:25:01 GMT

16b6
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
<soapenv:Body>
<ns:getGroupsResponse
xmlns:ns="http://soap.ws.grouper.middleware.internet2.edu/xsd";>
<ns:return
type="edu.internet2.middleware.grouper.ws.soap.WsGetGroupsResults">
<ns:responseMetadata
type="edu.internet2.middleware.grouper.ws.soap.WsResponseMeta">
<ns:millis>156</ns:millis>
<ns:resultWarnings
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:serverVersion>v1_4_002</ns:serverVersion>
</ns:responseMetadata>
<ns:resultMetadata
type="edu.internet2.middleware.grouper.ws.soap.WsResultMeta">
<ns:params xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:resultCode>SUCCESS</ns:resultCode>
<ns:resultCode2
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:resultMessage>Success for: clientVersion: v1_4_002,
subjectLookups: Array size: 2: [0]: WsSubjectLookup[subjectId=GrouperSystem]
[1]: WsSubjectLookup[subjectId=10021368]

memberFilter: All, includeGroupDetail: false, actAsSubject:
WsSubjectLookup[subjectId=GrouperSystem]
, params: Array size: 1: [0]: WsParam[paramName=fieldName,paramValue=admins]
, field: admins</ns:resultMessage>
<ns:success>T</ns:success>
</ns:resultMetadata>
<ns:results
type="edu.internet2.middleware.grouper.ws.soap.WsGetGroupsResult">
<ns:resultMetadata
type="edu.internet2.middleware.grouper.ws.soap.WsResultMeta">
<ns:params xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:resultCode>SUCCESS</ns:resultCode>
<ns:resultCode2
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:resultMessage
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:success>T</ns:success>
</ns:resultMetadata>
<ns:wsGroups
type="edu.internet2.middleware.grouper.ws.soap.WsGroup">
<ns:description>a group description2</ns:description>
<ns:detail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:displayExtension>a group2</ns:displayExtension>
<ns:displayName>a stem:a group2</ns:displayName>
<ns:extension>aGroup2</ns:extension>
<ns:name>aStem:aGroup2</ns:name>
<ns:uuid>8995097c-95a3-4bff-8c21-9e7b85aef150</ns:uuid>
</ns:wsGroups>
<ns:wsGroups
type="edu.internet2.middleware.grouper.ws.soap.WsGroup">
<ns:description>a group description</ns:description>
<ns:detail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:displayExtension>a group</ns:displayExtension>
<ns:displayName>a stem:a group</ns:displayName>
<ns:extension>aGroup</ns:extension>
<ns:name>aStem:aGroup</ns:name>
<ns:uuid>62582611-b117-4de8-807a-b3182d608240</ns:uuid>
</ns:wsGroups>
<ns:wsGroups
type="edu.internet2.middleware.grouper.ws.soap.WsGroup">
<ns:description
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:detail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:displayExtension>webServiceClientUsers</ns:displayExtension>
<ns:displayName>etc:webServiceClientUsers</ns:displayName>
<ns:extension>webServiceClientUsers</ns:extension>
<ns:name>etc:webServiceClientUsers</ns:name>
<ns:uuid>71340dc7-636d-4995-b1db-db1abb4e0353</ns:uuid>
</ns:wsGroups>
<ns:wsGroups
type="edu.internet2.middleware.grouper.ws.soap.WsGroup">
<ns:description
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:detail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:displayExtension>sysadmingroup</ns:displayExtension>
<ns:displayName>etc:sysadmingroup</ns:displayName>
<ns:extension>sysadmingroup</ns:extension>
<ns:name>etc:sysadmingroup</ns:name>
<ns:uuid>3181e69c-dd4e-41a5-b0a2-ea98b1128442</ns:uuid>
</ns:wsGroups>
<ns:wsGroups
type="edu.internet2.middleware.grouper.ws.soap.WsGroup">
<ns:description
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:detail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:displayExtension>webServiceActAsGroup</ns:displayExtension>
<ns:displayName>etc:webServiceActAsGroup</ns:displayName>
<ns:extension>webServiceActAsGroup</ns:extension>
<ns:name>etc:webServiceActAsGroup</ns:name>
<ns:uuid>c6876bd7-0757-4b3d-9908-fd7ac98081d1</ns:uuid>
</ns:wsGroups>
<ns:wsSubject
type="edu.internet2.middleware.grouper.ws.soap.WsSubject">
<ns:attributeValues></ns:attributeValues>
<ns:id>GrouperSystem</ns:id>
<ns:identifierLookup
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:resultCode>SUCCESS</ns:resultCode>
<ns:sourceId>g:isa</ns:sourceId>
<ns:success>T</ns:success>
</ns:wsSubject>
</ns:results>
<ns:results
type="edu.internet2.middleware.grouper.ws.soap.WsGetGroupsResult">
<ns:resultMetadata
type="edu.internet2.middleware.grouper.ws.soap.WsResultMeta">
<ns:params xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:resultCode>SUCCESS</ns:resultCode>
<ns:resultCode2
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:resultMessage
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:success>T</ns:success>
</ns:resultMetadata>
<ns:wsGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:wsSubject
type="edu.internet2.middleware.grouper.ws.soap.WsSubject">
<ns:attributeValues
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:id>10021368</ns:id>
<ns:identifierLookup
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:nil="true" />
<ns:name xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:nil="true" />
<ns:resultCode>SUCCESS</ns:resultCode>
<ns:sourceId>pennperson</ns:sourceId>
<ns:success>T</ns:success>
</ns:wsSubject>
</ns:results>
<ns:subjectAttributeNames></ns:subjectAttributeNames>
</ns:return>
</ns:getGroupsResponse>
</soapenv:Body>
</soapenv:Envelope>
0


#########################################
##
## Java source code (note, any programming language / objects
## can use used to generate the above request/response. Nothing
## is Java specific. Also, if you are using Java, the client libraries
## are available
##
#########################################


/**
*
*/
package edu.internet2.middleware.grouper.webservicesClient;

import org.apache.axis2.client.Options;
import org.apache.axis2.transport.http.HTTPConstants;
import org.apache.axis2.transport.http.HttpTransportProperties;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;

import
edu.internet2.middleware.grouper.webservicesClient.util.GeneratedClientSettings;
import edu.internet2.middleware.grouper.ws.samples.types.WsSampleGenerated;
import
edu.internet2.middleware.grouper.ws.samples.types.WsSampleGeneratedType;
import edu.internet2.middleware.grouper.ws.soap.xsd.GetGroups;
import edu.internet2.middleware.grouper.ws.soap.xsd.WsGetGroupsResult;
import edu.internet2.middleware.grouper.ws.soap.xsd.WsGetGroupsResults;
import edu.internet2.middleware.grouper.ws.soap.xsd.WsGroup;
import edu.internet2.middleware.grouper.ws.soap.xsd.WsParam;
import edu.internet2.middleware.grouper.ws.soap.xsd.WsSubjectLookup;


/**
* @author mchyzer
*
*/
public class WsSampleGetGroupsAdmins implements WsSampleGenerated {
/**
* @param args
*/
public static void main(String[] args) {
getGroupsAdmins(WsSampleGeneratedType.soap);
}

/**
* @see
edu.internet2.middleware.grouper.ws.samples.types.WsSampleGenerated#executeSample(edu.internet2.middleware.grouper.ws.samples.types.WsSampleGeneratedType)
*/
public void executeSample(WsSampleGeneratedType wsSampleGeneratedType) {
getGroupsAdmins(wsSampleGeneratedType);
}

/**
* @param wsSampleGeneratedType can run as soap or xml/http
*/
public static void getGroupsAdmins(WsSampleGeneratedType
wsSampleGeneratedType) {
try {
//URL, e.g.
http://localhost:8091/grouper-ws/services/GrouperService
GrouperServiceStub stub = new
GrouperServiceStub(GeneratedClientSettings.URL);
Options options = stub._getServiceClient().getOptions();
HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
auth.setUsername(GeneratedClientSettings.USER);
auth.setPassword(GeneratedClientSettings.PASS);
auth.setPreemptiveAuthentication(true);

options.setProperty(HTTPConstants.AUTHENTICATE, auth);
options.setProperty(HTTPConstants.SO_TIMEOUT, new
Integer(3600000));
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT,
new Integer(3600000));

GetGroups getGroups = GetGroups.class.newInstance();

//set the act as id
WsSubjectLookup actAsSubject =
WsSubjectLookup.class.newInstance();
actAsSubject.setSubjectId("GrouperSystem");
getGroups.setActAsSubjectLookup(actAsSubject);

//version, e.g. v1_3_000
getGroups.setClientVersion(GeneratedClientSettings.VERSION);

//check all
getGroups.setMemberFilter("All");

WsSubjectLookup wsSubjectLookup =
WsSubjectLookup.class.newInstance();
wsSubjectLookup.setSubjectId("GrouperSystem");

WsSubjectLookup wsSubjectLookup2 =
WsSubjectLookup.class.newInstance();
wsSubjectLookup2.setSubjectId("10021368");
getGroups.setSubjectLookups(new WsSubjectLookup[] {
wsSubjectLookup, wsSubjectLookup2
});

WsParam param = new WsParam();

param.setParamName("fieldName");
param.setParamValue("admins");

getGroups.setParams(new WsParam[] {param});

getGroups.setIncludeGroupDetail("F");
getGroups.setIncludeSubjectDetail("F");
getGroups.setSubjectAttributeNames(new String[]{""});

WsGetGroupsResults wsGetGroupsResults = stub.getGroups(getGroups)
.get_return();

System.out.println(ToStringBuilder.reflectionToString(
wsGetGroupsResults));

WsGetGroupsResult[] results = wsGetGroupsResults.getResults();

if (results != null) {
for (WsGetGroupsResult result : results) {
WsGroup[] wsGroups = result.getWsGroups();

if (wsGroups != null) {
for (WsGroup wsGroup : wsGroups) {

System.out.println(ToStringBuilder.reflectionToString(
wsGroup));
}
}
}
}

if (!StringUtils.equals("T",
wsGetGroupsResults.getResultMetadata().getSuccess())) {
throw new RuntimeException("didnt get success! ");
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}


#########################################
##
## Stdout
##
#########################################


WsGetGroupsResults[

localResponseMetadata=edu.internet2.middleware.grouper.ws.soap.xsd.WsResponseMeta@9468ca,localResponseMetadataTracker=true,

localResultMetadata=edu.internet2.middleware.grouper.ws.soap.xsd.WsResultMeta@16bc6e5,localResultMetadataTracker=true,

localResults={edu.internet2.middleware.grouper.ws.soap.xsd.WsGetGroupsResult@1668534,edu.internet2.middleware.grouper.ws.soap.xsd.WsGetGroupsResult@1b3409f},localResultsTracker=true,
localSubjectAttributeNames={},localSubjectAttributeNamesTracker=true]
WsGroup[localDescription=a group
description2,localDescriptionTracker=true,localDetailTracker=true,localDisplayExtension=a
group2,localDisplayExtensionTracker=true,localDisplayName=a stem:a
group2,localDisplayNameTracker=true,localExtension=aGroup2,localExtensionTracker=true,localName=aStem:aGroup2,localNameTracker=true,localUuid=8995097c-95a3-4bff-8c21-9e7b85aef150,localUuidTracker=true]
WsGroup[localDescription=a group
description,localDescriptionTracker=true,localDetailTracker=true,localDisplayExtension=a
group,localDisplayExtensionTracker=true,localDisplayName=a stem:a
group,localDisplayNameTracker=true,localExtension=aGroup,localExtensionTracker=true,localName=aStem:aGroup,localNameTracker=true,localUuid=62582611-b117-4de8-807a-b3182d608240,localUuidTracker=true]
WsGroup[localDescriptionTracker=false,localDetailTracker=true,localDisplayExtension=webServiceClientUsers,localDisplayExtensionTracker=true,localDisplayName=etc:webServiceClientUsers,localDisplayNameTracker=true,localExtension=webServiceClientUsers,localExtensionTracker=true,localName=etc:webServiceClientUsers,localNameTracker=true,localUuid=71340dc7-636d-4995-b1db-db1abb4e0353,localUuidTracker=true]
WsGroup[localDescriptionTracker=false,localDetailTracker=true,localDisplayExtension=sysadmingroup,localDisplayExtensionTracker=true,localDisplayName=etc:sysadmingroup,localDisplayNameTracker=true,localExtension=sysadmingroup,localExtensionTracker=true,localName=etc:sysadmingroup,localNameTracker=true,localUuid=3181e69c-dd4e-41a5-b0a2-ea98b1128442,localUuidTracker=true]
WsGroup[localDescriptionTracker=false,localDetailTracker=true,localDisplayExtension=webServiceActAsGroup,localDisplayExtensionTracker=true,localDisplayName=etc:webServiceActAsGroup,localDisplayNameTracker=true,localExtension=webServiceActAsGroup,localExtensionTracker=true,localName=etc:webServiceActAsGroup,localNameTracker=true,localUuid=c6876bd7-0757-4b3d-9908-fd7ac98081d1,localUuidTracker=true]
<null>



Archive powered by MHonArc 2.6.16.

Top of Page