<Schema>
<Entry>
<DistinguishedName>...</DistinguishedName>
<ObjectClass>...</ObjectClass>
<Attributes>
<Attribute1>...</Attribute1>
<Attribute2>...</Attribute2>
.
.
<AttributeN>...</AttributeN>
</Attributes>
</Entry>
.
.
<Entry>
<DistinguishedName>...</DistinguishedName>
<ObjectClass>...</ObjectClass>
<Attributes>
<Attribute1>...</Attribute1>
<Attribute2>...</Attribute2>
.
.
<AttributeN>...</AttributeN>
</Attributes>
</Entry>
</Schema>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Schema>
<Entry>
<Attributes>
<name>Administrator</name>
</Attributes>
</Entry>
<Entry>
<Attributes>
<name>Guest</name>
</Attributes>
</Entry>
<Entry>
<Attributes>
<name>John</name>
</Attributes>
</Entry>
..
..
</Schema>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Schema>
<Entry>
<objectClass>top;person;organizationalPerson;user</objectClass> <distinguishedName>CN=john,CN=Users,DC=XXXXXX,DC=XXXXXX,DC=sap,DC=corp</distinguishedName>
<Attributes>
<proxyAddresses>abc@sap.com;test@gmail.com</proxyAddresses>
<sAMAccountType>805306368</sAMAccountType>
<primaryGroupID>513</primaryGroupID>
<badPasswordTime>0</badPasswordTime> <objectCategory>CN=Person,CN=Schema,CN=Configuration,DC=XXXXXX,DC=XXXXXX,DC=sap,DC=corp</objectCategory>
<mail>john.doe@sap.com</mail>
<cn>john</cn>
<userAccountControl>514</userAccountControl>
<telephoneNumber>2343434</telephoneNumber>
<dSCorePropagationData>16010101000000.0Z</dSCorePropagationData>
<codePage>0</codePage>
<whenChanged>20191219091709.0Z</whenChanged>
<whenCreated>20191219091709.0Z</whenCreated>
<pwdLastSet>0</pwdLastSet>
<logonCount>0</logonCount>
<accountExpires>9223372036854775807</accountExpires>
<lastLogoff>0</lastLogoff>
<objectGUID>c5142903-68fb-4dab-9f47-b10da758e707</objectGUID>
<lastLogon>0</lastLogon>
<uSNChanged>259902</uSNChanged>
<uSNCreated>259901</uSNCreated>
<objectSid>S-1-5-21-3722266703-2459750493-1115606453-17015</objectSid>
<countryCode>0</countryCode>
<sAMAccountName>john</sAMAccountName>
<instanceType>4</instanceType>
<badPwdCount>0</badPwdCount>
<name>john</name>
</Attributes>
</Entry>
<Entry>
<objectClass>top;person;organizationalPerson;user</objectClass> <distinguishedName>CN=johnny,CN=Users,DC=XXXXXX,DC=XXXXXX,DC=sap,DC=corp</distinguishedName>
<Attributes>
<sAMAccountType>805306368</sAMAccountType>
<primaryGroupID>513</primaryGroupID>
<badPasswordTime>0</badPasswordTime> <objectCategory>CN=Person,CN=Schema,CN=Configuration,DC=XXXXXX,DC=XXXXXX,DC=sap,DC=corp</objectCategory>
<mail>johnny.doe01@sap.com</mail>
<cn>johnny</cn>
<userAccountControl>514</userAccountControl>
<codePage>0</codePage>
<whenChanged>20191219091734.0Z</whenChanged>
<whenCreated>20191219091734.0Z</whenCreated>
<pwdLastSet>0</pwdLastSet>
<logonCount>0</logonCount>
<accountExpires>9223372036854775807</accountExpires>
<lastLogoff>0</lastLogoff>
<objectGUID>e8e94bd0-73c9-44fc-8382-229b25773621</objectGUID>
<lastLogon>0</lastLogon>
<uSNChanged>259905</uSNChanged>
<uSNCreated>259904</uSNCreated>
<objectSid>S-1-5-21-3722266703-2459750493-1115606453-17016</objectSid>
<countryCode>0</countryCode>
<sAMAccountName>johnny</sAMAccountName>
<instanceType>4</instanceType>
<badPwdCount>0</badPwdCount>
<name>johnny</name>
</Attributes>
</Entry>
</Schema>
// String representation of the list
[{distinguishedname=distinguishedName: CN=hci1,CN=Users,DC= XXXXXX,DC= XXXXXX,DC=sap,DC=corp}]
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.List;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.BasicAttribute;
import javax.naming.directory.BasicAttributes;
import javax.naming.NamingEnumeration;
def Message processData(Message message) {
//Body
List<Attributes> body = message.getBody();
// Iterate over the entities
for(Attributes attributes : body){
NamingEnumeration enumeration = attributes.getAll();
// Iterate over the attributes of the entity
while (enumeration.hasMore()) {
BasicAttribute attribute = (BasicAttribute) enumeration.next();
// Attribute Key
String attributeName = attribute.getID();
// Attribute Value
String attributeValue = (String) attribute.get();
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
messageLog.addAttachmentAsString(attributeName, attributeValue, "text/xml");
}
}
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Schema>
<Entry>
<Attributes>
<name>Annie Benitha</name>
<age>28</age>
<title>Miss</title>
<registeredAddress>Richmond Road, Bangalore</registeredAddress>
</Attributes>
</Entry>
<Entry>
<Attributes>
<name>Sadiya Kauser</name>
<age>29</age>
<title>Mrs</title>
<registeredAddress>Tippsandra Colony, Bangalore</registeredAddress>
</Attributes>
</Entry>
<Entry>
<Attributes>
<name>Deepa U</name>
<age>31</age>
<title>Mrs</title>
<registeredAddress>HSR Layout, Bangalore</registeredAddress>
</Attributes>
</Entry>
<Entry>
<Attributes>
<name>Mahashwetha Rao</name>
<age>39</age>
<title>Ms</title>
<registeredAddress>Ganganagar,2nd cross,Sector 8, Bangalore</registeredAddress>
</Attributes>
</Entry>
<Entry>
<Attributes>
<name>Aliya Amreen</name>
<age>35</age>
<title>Mrs</title>
<registeredAddress>HRBR Layout Bangalore</registeredAddress>
</Attributes>
</Entry>
</Schema>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Schema>
<Entry>
<objectClass>top;person;company</objectClass>
</Entry>
<Entry>
<objectClass>top;person;company</objectClass>
</Entry>
</Schema>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
58 | |
20 | |
11 | |
11 | |
9 | |
7 | |
6 | |
6 | |
6 | |
4 |