Freigeben über


addressMap Element

The addressMap element in the Web.config file identifies how Commerce Server maps the properties of an address in the Profiles System to the properties of an OrderAddress object in the Orders System.

The addressMap element is a child of the orders Element, and is required.

The addressMap element contains two child elements: the profileDefinition element and the property element.

profileDefinition Element

The profileDefinition element specifies the name of the profile definition whose properties will be used to populate an OrderAddress object. This element is optional.

The following table lists the attributes of the profileDefinition element.

Attribute

Data Type

Description

name

String

The name of the profile that contains the address information. The default value is "Address".

This attribute is required.

property Element

The property element specifies a mapping from a property of an address in the Profiles System to a property of an OrderAddress in the Orders System. There can be more than one property element within the addressMap element. This element is optional.

The following table lists the attributes of the property element.

Attribute

Data Type

Description

from

String

The name of the property in the Profiles System.

This attribute is required.

to

String

The name of the member variable of the OrderAddress object that the property maps to.

Dd328343.alert_note(en-US,CS.90).gifNote:
If the OrderAddress object does not have a member variable with this name, then a new weakly typed indexer property is added.

This attribute is required.

If you omit the orders element, the default values for the addressMap element will be used to map the properties of an address in the Profiles System to the properties of an OrderAddress object in the Orders System. However, if you include the orders element but omit the addressMap element within the orders element, then no address profile properties will be mapped to an OrderAddress object.

Commerce Server provides the following default mappings from the Address profile.

From

To

GeneralInfo.address_id

OrderAddressId

GeneralInfo.first_name

FirstName

GeneralInfo.last_name

LastName

GeneralInfo.address_line1

Line1

GeneralInfo.address_line2

Line2

GeneralInfo.city

City

GeneralInfo.region_code

RegionCode

GeneralInfo.postal_code

PostalCode

GeneralInfo.country_name

CountryName

GeneralInfo.region_name

State

GeneralInfo.tel_number

DaytimePhoneNumber

Example

<addressMap>
    <profileDefinition name="Address"/>
    <property from="GeneralInfo.address_id" to="OrderAddressId"/>
    <property from="GeneralInfo.first_name" to="FirstName"/>
    <property from="GeneralInfo.last_name" to="LastName"/>
    <property from="GeneralInfo.address_line1" to="Line1"/>
    <property from="GeneralInfo.address_line2" to="Line2"/>
    <property from="GeneralInfo.city" to="City"/>
    <property from="GeneralInfo.region_code" to="RegionCode"/>
    <property from="GeneralInfo.postal_code" to="PostalCode"/>
    <property from="GeneralInfo.country_name" to="CountryName"/>
    <property from="GeneralInfo.region_name" to="State"/>
    <property from="GeneralInfo.tel_number" to="DaytimePhoneNumber"/>
 </addressMap>

See Also

Reference

OrderAddress

Other Resources

orders Element

Web.Config Configuration Settings