Method description

replaceMemberships is a method to change the roleType for persons in a given group.

replaceMembership and updateMembership can only be used to update the roleType or home organisation of existing member. To add, remove or change person to group assignment, use createMembership/deleteMembership instead.

Preconditions for use

You will need to know the membership syncID, as well as the syncID of the groups and the syncID of the persons who should be updated




Message Schema

Input parameters / request message elements

Name

Description

Data type

Allowed values

M/O

<membershipIdPairSet>

Wrapper for a list of <membershipIdPair> elements



M

<membershipIdPair>

Wrapper for a set of one <sourcedId><identifier> element and one <membership> element.



M

<sourcedId><identifier>

A unique identifier for this set of group / person mappings

Text

Max 255 characters

M

<membership>

Wrapper element for one <groupSourcedId ><identifier> element and one or more <member> elements



M

<membership><groupSourcedId ><identifier>

The syncID for the group that will have a member

Text

M

<membership><member><memberSourcedId ><identifier>

The syncID for the person to add as a member

Text


M

Please refer to the WSDL for the full element structure, only key elements are described here

Response message elements


Name

Description

Data type

replaceMembershipsResponse

Empty response element

Empty

Comments

For each <membershipIdPair><sourcedId><identifier> in the request you will get a status in the <statusinfoSet><status> in the response.
The order of the <statusInfoset><status> corresponds to the the order of the <membershipIdPair><sourcedId><identifier> in the request.


Example

Description

I have a group C with syncID = G2 in itslearning
I have a persons B with syncID =99998888 itslearning.
I want the person B to become a member of hierarchy group C in itslearning. Role in hierarchy should be teacher.

I have a group D with syncID = G3 in itslearning
I have a persons B with syncID = 99998888 itslearning.
I want the person B become a member of hierarchy group D in itslearning. Role in hierarchy should be student.

Example request message

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ims="http://www.imsglobal.org/services/common/imsMessBindSchema_v1p0" xmlns:ims1="http://www.imsglobal.org/services/mms/xsd/imsMemberManMessSchema_v1p0" xmlns:ims2="http://www.imsglobal.org/services/common/imsCommonSchema_v1p0" xmlns:ims3="http://www.imsglobal.org/services/mms/xsd/imsMemberManDataSchema_v1p0">
<soapenv:Header>
<ims:syncRequestHeaderInfo>
<ims:messageIdentifier>1</ims:messageIdentifier>
</ims:syncRequestHeaderInfo>
</soapenv:Header>
<soapenv:Body>
<ims1:replaceMembershipsRequest>
<ims1:membershipIdPairSet>
<ims1:membershipIdPair>
<ims1:sourcedId>
<ims2:identifier>M2</ims2:identifier>
</ims1:sourcedId>
<ims1:membership>
<ims3:groupSourcedId>
<ims2:identifier>G2</ims2:identifier>
</ims3:groupSourcedId>
<ims3:member>
<ims3:memberSourcedId>
<ims2:identifier>99998888</ims2:identifier>
</ims3:memberSourcedId>
<ims3:role>
<ims3:roleType>02</ims3:roleType>
</ims3:role>
</ims3:member>
</ims1:membership>
</ims1:membershipIdPair>
<ims1:membershipIdPair>
<ims1:sourcedId>
<ims2:identifier>M3</ims2:identifier>
</ims1:sourcedId>
<ims1:membership>
<ims3:groupSourcedId>
<ims2:identifier>G3</ims2:identifier>
</ims3:groupSourcedId>
<ims3:member>
<ims3:memberSourcedId>
<ims2:identifier>99998888</ims2:identifier>
</ims3:memberSourcedId>
<ims3:role>
<ims3:roleType>01</ims3:roleType>
</ims3:role>
</ims3:member>
</ims1:membership>
</ims1:membershipIdPair>
</ims1:membershipIdPairSet>
</ims1:replaceMembershipsRequest>
</soapenv:Body>
</soapenv:Envelope>


Example response message

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:syncResponseHeaderInfo>
<messageIdentifier>1</messageIdentifier>
<statusInfoSet>
<statusInfo>
<codeMajor>success</codeMajor>
<severity>status</severity>
<messageIdRef>1</messageIdRef>
</statusInfo>
<statusInfo>
<codeMajor>success</codeMajor>
<severity>status</severity>
<messageIdRef>1</messageIdRef>
</statusInfo>
</statusInfoSet>
</h:syncResponseHeaderInfo>
<o:Security s:mustUnderstand="1">
<u:Timestamp u:Id="_0">
<u:Created>2011-02-03T15:41:56.578Z</u:Created>
<u:Expires>2011-02-03T15:46:56.578Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body>
<replaceMembershipsResponse/>
</s:Body>
</s:Envelope>