replaceMembership

Method description

replaceMembership is a method to update, replace or create a new membership. If the syncID for the membership exists in itslearning, the membership will be updated. If not, a new membership will be created.

replaceMembership is functionally equivalent to updateMembership

replaceMembership and updateMembership can only be used to update the roleType 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 group and the syncID of the person who should be updated or created

Message Schema

Input parameters / request message elements

Name

Description

Data type

Allowed values

M/O

<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

replaceMembershipResponse

Empty response element

Empty

Example

Description

I want to insert or update a membership in itslearning;

Person with syncID = 99998888 is a member of hierarchy Group G1. His role in hierarchy should be changed to 01.

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:replaceMembershipRequest>
<ims1:sourcedId>
<ims2:identifier>M1</ims2:identifier>
</ims1:sourcedId>
<ims1:membership>
<ims3:groupSourcedId>
<ims2:identifier>G1</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:replaceMembershipRequest>
</soapenv:Body>
</soapenv:Envelope>

Example response message

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope ">
<s:Header>
<h:syncResponseHeaderInfo>
<messageIdentifier>1</messageIdentifier>
<statusInfo>
<codeMajor>success</codeMajor>
<severity>status</severity>
<messageIdRef>1</messageIdRef>
</statusInfo>
</h:syncResponseHeaderInfo>
<o:Security s:mustUnderstand="1">
<u:Timestamp u:Id="_0">
<u:Created>2011-02-03T15:34:59.983Z</u:Created>
<u:Expires>2011-02-03T15:39:59.983Z</u:Expires>
</u:Timestamp>
</o:Security>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<replaceMembershipResponse/>
</s:Body>
</s:Envelope>