IProfileObject2::GetProfileXML Method [C++]

Use this method to retrieve the XML schema and data of the profile object.

Definition

[C++]

HRESULT IProfileObject2::GetProfileXML(XMLRetrieveEnumeRetrieveEnum,
  VARIANT_BOOLbAttributeCentric,
  BSTR*pbstrXML);

[Visual Basic]

Function GetProfileXML(eRetrieveEnum As XMLRetrieveEnum,
  bAttributeCentric As Boolean) As String

Parameters

  • eRetrieveEnum [C++]
    [in] An Enum that indicates whether to retrieve the XML schema, data, or both.
  • eRetrieveEnum[Visual Basic]
    [in] An Enum that indicates whether to retrieve the XML schema, data, or both.
  • bAttributeCentric[C++]
    [in] A VARIANT_BOOL that indicates 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.
  • bAttributeCentric[Visual Basic]
    [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.
  • pbstrXML[C++]
    [out, retval] A pointer to a BSTR that contains the resulting XML fragment.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] This method returns a String containing the XML representation of the profile object.

Error Values

[C++] The Errors property of the ProfileService object stores the collection of errors encountered in the last Profiles resource operation. For more information, see IProfileService::get_Errors.

[Visual Basic] 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

[C++]

The pbstrXML parameter contains valid data only if the method completes successfully.

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.

[Visual Basic]

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="MyAdminID">
      </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>MyAdminID</user_id_changed_by>
      </GeneralInfo>
   </UserObject>
   </ProfileDocument>

See Also

[C++]ProfileObject Object

[C++]IProfileObject2::get_Fields

[C++]Profile XML Structures

[Visual Basic]ProfileObject Object

[Visual Basic]ProfileObject.Fields

[Visual Basic]Profile XML Structures

Copyright © 2005 Microsoft Corporation.
All rights reserved.