Skip to Content.
Sympa Menu

grouper-users - [grouper-users] Attempting to add an "external subject" with Grouper REST API

Subject: Grouper Users - Open Discussion List

List archive

[grouper-users] Attempting to add an "external subject" with Grouper REST API


Chronological Thread 
  • From: Keith Hazelton <>
  • To:
  • Subject: [grouper-users] Attempting to add an "external subject" with Grouper REST API
  • Date: Fri, 26 Oct 2012 11:41:08 -0500

I want to put an external subject into a Grouper group using the RESTful web
services. The subject is identified by a Bamboo Person ID, which is just a
value like
urn:uuid:e700afeb-daee-4d49-99ed-1753127e8985

The Grouper WS documentation on Add Member
(https://spaces.internet2.edu/display/Grouper/Add+Member) has the following
under "Features"

"You can specify addExternalSubjectIfNotFound to T or F, if this is a search
by id or identifier, with no source, or the external source, and the subject
is not found, then add an external subject (if the user is allowed to do
this)"

I'm using Firefox Poster for a proof of concept, and wondering what to put in
the request body to set addExternalSubjectIfNotFound to "T".

Advice welcome, --Keith

_________________
I made a WAG, tried the following and got errors:
----------
url: http://arche.metazome.info:8480/grouper-ws/servicesRest/v2_1_000/groups
content type: text/xml
POST
content:
<WsRestAddMemberLiteRequest>

<groupName>458930f0-0716-11e2-892e-0800200c9a66:560d5c90-c23e-4e7c-903b-eab046b38cbc:xyz-1</groupName>
<subjectId>urn:uuid:b386e4fd-38e6-4915-8c11-c9dc00963f3e</subjectId>
<addExternalSubjectifNotFound>T</addExternalSubjectIfNotFound>
<actAsSubjectId>GrouperSystem</actAsSubjectId>
</WsRestAddMemberLiteRequest>
----------

If I omit the line
<addExternalSubjectifNotFound>T</addExternalSubjectIfNotFound>T</addExternalSubjectIfNotFound>
I get the expected "subject not found" error, since this subject is not
available via any configured subject adapter

With that line in the request, I get this 500 error:
-----------
<WsRestResultProblem><resultMetadata><resultCode>EXCEPTION</resultCode><resultMessage>Problem
with request: uri: /grouper-ws/servicesRest/v2_1_000/groups, method: POST,
decoded url strings: 0: &apos;v2_1_000&apos;, 1: &apos;groups&apos;,
com.thoughtworks.xstream.converters.ConversionException:
addExternalSubjectifNotFound : addExternalSubjectifNotFound :
addExternalSubjectifNotFound : addExternalSubjectifNotFound
---- Debugging information ----
message : addExternalSubjectifNotFound :
addExternalSubjectifNotFound
cause-exception :
com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : addExternalSubjectifNotFound :
addExternalSubjectifNotFound
class :
edu.internet2.middleware.grouper.ws.rest.member.WsRestAddMemberLiteRequest
required-type :
edu.internet2.middleware.grouper.ws.rest.member.WsRestAddMemberLiteRequest
line number : 4
-------------------------------
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:88)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:142)
at
com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:931)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:917)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
at
edu.internet2.middleware.grouper.ws.rest.contentType.WsRestRequestContentType$3.parseString(WsRestRequestContentType.java:159)
at
edu.internet2.middleware.grouper.ws.rest.GrouperRestServlet.service(GrouperRestServlet.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
edu.internet2.middleware.grouper.ws.GrouperServiceJ2ee.doFilter(GrouperServiceJ2ee.java:653)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException:
addExternalSubjectifNotFound : addExternalSubjectifNotFound
at
com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:62)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:71)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:86)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:87)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:52)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.determineType(AbstractReflectionConverter.java:318)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:196)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:150)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
... 27 more
</resultMessage><success>F</success></resultMetadata><responseMetadata><resultWarnings></resultWarnings><millis>5</millis><serverVersion>2.1.2</serverVersion></responseMetadata></WsRestResultProblem>
----------





Archive powered by MHonArc 2.6.16.

Top of Page