Share via


CreateProfile Method

Creates a new profile instance in the profile system.

Namespace:  Microsoft.CommerceServer.Profiles
Assembly:  Microsoft.CommerceServer.Profiles.CrossTierTypes (in Microsoft.CommerceServer.Profiles.CrossTierTypes.dll)

Syntax

'Declaration
Public Function CreateProfile ( _
    profileXml As XmlElement _
) As ProfileOperationResponse
'Usage
Dim instance As ProfileManagementContext
Dim profileXml As XmlElement
Dim returnValue As ProfileOperationResponse

returnValue = instance.CreateProfile(profileXml)
public ProfileOperationResponse CreateProfile(
    XmlElement profileXml
)
public:
ProfileOperationResponse^ CreateProfile(
    XmlElement^ profileXml
)
public function CreateProfile(
    profileXml : XmlElement
) : ProfileOperationResponse

Parameters

Return Value

Type: Microsoft.CommerceServer.Profiles..::.ProfileOperationResponse
An object describing the profile that was created.

Exceptions

Exception Condition
ArgumentNullException

Any of the parameters provided is nullNothingnullptra null reference (Nothing in Visual Basic).

AuthenticationException

User has not been authenticated.

NotAuthorizedException

User is not authorized to perform this task.

DuplicateKeyValueException

A profile with the provided primary key already exists.

DefinitionDoesNotExistException

The profile definition named in the profileXml does not exist.

PropertyDoesNotExistException

A profile property named in the profileXml does not exist.

XmlException

The profileXml provided is not correctly formatted.

StringLengthValidationException

A string property specified in profileXml is greater than 8,000 characters, or within the constraints specified by the MinLength and MaxLength profile definition custom attribute.

MinimumValueValidationException

A number property specified in profileXml is less than the MinLength constraint specified on the profile definition.

MaximumValueValidationException

A number property specified in profileXml is greater than the MaxLength constraint specified on the profile definition.

PropertyNullValidationException

A required property was not provided in the profileXml.

PropertyTypeValidationException

One of the profile property values provided is not the correct type.

Remarks

This API will create a new profile instance in the profile system. Not all properties need to be supplied in the profileXml, however. Only those properties that have

isRequired="true"

in the profile definition must be supplied to this API.

Permissions

See Also

Reference

ProfileManagementContext Class

ProfileManagementContext Members

Microsoft.CommerceServer.Profiles Namespace