Previous Topic: Example: Create an Account within a Sub-Container

Next Topic: Example: Add a Single-Valued Complex Attribute

Complex Attributes

Objects, such as User, have attributes. Most attributes are of simple types like string, integer, or Boolean. The “address” or “createStatistics” attributes, however, are of complex types as they contain nested elements. For example “street," “city," “country," “state” and “postcode” are nested fields of an “address” attribute. When you add a complex attribute, the Identifier of the complex attribute has the following special format:

attributeName@ID_Of_The_Actual_Object

Some complex attributes are multi-valued, such as the list of self authentication questions and answers for a Global User.

For multi-valued complex attributes, the Identifier format is as follows, with the #index to indicate the index of the attribute value. The index always start from 0:

attributeName#index@ID_Of_The_Actual_Object

Simple attributes can be populated when you add an object:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addRequest xmlns="urn:oasis:names:tc:SPML:1:0" xmlns:dsml="urn:oasis:names:tc:DSML:2:0:core">
    <identifier type="urn:oasis:names:tc:SPML:1:0#DN">
        <id>User=new_global_user,Domain=EXAMPLE_DOMAIN,Server=Server</id>
    </identifier>
    <attributes>
        <attr name="accountId">
            <dsml:value>new_global_user</dsml:value>
        </attr>
        <attr name="firstName">
            <dsml:value>new_global_user</dsml:value>
        </attr>
    </attributes>
</addRequest>

But complex attributes must be populated afterwards in a separate AddRequest.