ProfileObject.GetProfileXML
Use this method to retrieve the XML schema and data of the profile object.
Definition
Function GetProfileXML(eRetrieveEnum As XMLRetrieveEnum,bAttributeCentric As Boolean) As String
Parameters
eRetrieveEnum
[in] An Enum that indicates whether to retrieve the XML schema, data, or both.
bAttributeCentric
[in] A Boolean that indicates if the XML output format. Set this parameter to True (1) to retrieve the XML in an attribute-centric format, and to False (0) to retrieve the XML in an element-centric format.
Return Values
This method returns a String containing the XML representation of the profile object.
Error Values
The Errors property of the ProfileService object stores the collection of errors encountered in the last Profiles resource operation. For more information, see ProfileService.Errors.
Remarks
The following table defines the possible values for XMLRetrieveEnum.
Name | Value | Description |
psRetrieveInvalidValue | 0 | Invalid option |
psRetrieveSchemaAndData | 1 | Both the schema and data are retrieved. |
psRetrieveDataOnly | 2 | Only the data is retrieved. |
psRetrieveSchemaOnly | 3 | Only the schema is retrieved. |
For information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
Example
' sXMLProfile is a String, oProfileObject is a UserObject profile
sXMLProfile = oProfileObject.GetProfileXML(psRetrieveDataOnly, True)
' The attribute-centric sXMLProfile string now contains:
<?xml version="1.0"?>
<ProfileDocument>
<UserObject>
<AccountInfo org_id="{590858E1-08A7-11D3-B8C4-00104B95AE0E}"
account_status="1" date_registered="2000- 6- 5T 0: 0: 0">
</AccountInfo>
<GeneralInfo user_id="{590858DB-08A7-11D3-B8C4-00104B95FFFF}"
logon_name="jilluser@microsoft.com"
user_security_password="password" user_title="" last_name="User"
first_name="Jill" user_id_changed_by="admin">
</GeneralInfo>
</UserObject>
</ProfileDocument>
sXMLProfile = oProfileObject.GetProfileXML(psRetrieveDataOnly, False)
' The element-centric sXMLProfile string now contains:
<?xml version="1.0"?>
<ProfileDocument>
<UserObject>
<AccountInfo>
<org_id>{590858E1-08A7-11D3-B8C4-00104B95AE0E}</org_id>
<account_status>1</account_status>
<date_registered>2000- 6- 5T 0: 0: 0</date_registered>
</AccountInfo>
<GeneralInfo
<user_id>{590858DB-08A7-11D3-B8C4-00104B95FFFF}</user_id>
<logon_name>jilluser@microsoft.com</logon_name>
<user_security_password>password</user_security_password>
<user_title></user_title>
<last_name>User</last_name>
<first_name>Jill</first_name>
<user_id_changed_by>admin</user_id_changed_by>
</GeneralInfo>
</UserObject>
</ProfileDocument>