There is a custom attribute assigned to a developer called 'XYZ'. In the API proxy, how can the AccessEntity policy (along with the AssignMessage and ExtractVariable policies as given in the tutorial: http://apigee.com/docs/api-services/content/retrieve-entity-profiles-using-accessentity) be used to retrieve the value for it so that it can be accessed further in Javascript? The example given in the tutorial doc is not very clear.
I have the following configurations that are not working. 'XYZ' is the name of the developer's custom attribute:
AccessEntity policy-
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AccessEntity async="false" continueOnError="false" enabled="true" name="access-developer-attribute">
<DisplayName>AccessEntity Developer Attribute</DisplayName>
<FaultRules/>
<Properties/>
<EntityIdentifier ref="XYZ"></EntityIdentifier>
<EntityType value="developer"></EntityType>
</AccessEntity>
AssignMessage policy -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="convert-accessentity-xml-to-message-request">
<DisplayName>Convert AccessEntity Xml To Message Request</DisplayName>
<FaultRules/>
<Properties/>
<Set>
<Headers/>
<QueryParams/>
<FormParams/>
<Verb/>
<Path/>
<Payload type="text/xml">AccessEntity.access-developer-attribute</Payload>
</Set>
<AssignVariable>
<Name>name</Name>
<Value/>
<Ref/>
</AssignVariable>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<AssignTo createNew="true" transport="http" type="request">accessentity.XYZ-attribute</AssignTo>
</AssignMessage>
ExtractVariables policy -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="retrieve-developer-attribute">
<DisplayName>Retrieve Developer Domain</DisplayName>
<FaultRules/>
<Properties/>
<IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
<Source>accessentity.XYZ-attribute</Source>
<VariablePrefix>developer_attribute</VariablePrefix>
<XMLPayload stopPayloadProcessing="false">
<Namespaces/>
<Variable name="xyz" type="string">
<XPath>/Developer/Attributes/XYZ</XPath>
</Variable>
</XMLPayload>
</ExtractVariables>
Javascript -
var xyzValue = context.getVariable("developer_attribute.xyz");