Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Messaging workstep : Message descriptor
 

Message descriptor

A message descriptor provides the description of a message in XML format. The messages with different XML Schema have unique names. In addition to the unique message name, the message descriptor also contains, the message template and its namespaces, meta-data for the message header and the message payload, and message correlation properties. All the properties defined in the <Header> and <Payload> sections of a message descriptor should have unique names.
A broad structure of a Message Descriptor is shown below.
<MessageDescriptor name="{name to identify a message}">
    <Template location="" encoding="base64"/>
    <Header/>
    <Payload>
    <Property name="{prop-name}" type="java.lang.String">
    <Xpath></XPath>
    </Property>
    </Payload>
    <Correlations>
    <Correlation name="{corr-name}"/>
    <Correlations>
    <Namespaces/>
</MessageDescriptor>
Each section of the message descriptor is described in the following sections. An example of a message descriptor is given in the following section.

Example of a message descriptor

<MessageDescriptor xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="MessageDescriptor.xsd">
    <Message name="NewProduct">
    <Template>
    <Product>
        <Id/>
        <Name/>
        <Price/>
    </Product>
    </Template>
    <Header>
    <Property name="ReceiverAppName"/>
    <Property name="ReceiverInstanceId" type="long"/>
    <Property name="ReceiverTaskName"/>
    <Property name="ReceiverPriority" />
    <Property name="ReceiverInstanceAlias"/>
    <Property name="SenderAppName" />
    <Property name="SenderTemplateName"/>
    <Property name="SenderInstanceId" type="long"/>
    <Property name="SenderTaskName"/>
    <Property name="SenderEmail"/>
    <Property name="MySenderProp" type="java.lang.String"/>
    </Header>
    <Payload>
    <Property name="product" type="java.lang.String"> //to get the entire payload as XML
    <XPath>/Product</XPath>
    </Property>
    <Property name="productDetail" type="java.lang.String"> //to get part of the payload as XML
    <XPath>/Product/Name</XPath>
    </Property>
    <Property name="prodId"> //to read a specific value in payload
    <Xpath>/Product/Id/text()</XPath>
    </Property>
    <Property name="prodName">
    <Xpath>/Product/Name/text()</XPath>
    </Property>
    <Property name="price" type="long">
    <Xpath>/Product/Price/text()</XPath>
    </Property>
    </Payload>
    <Correlations>
    <Correlation name="ProductPK">
    <Property name="prodId"/>
    </Correlation>
    </Correlations>
    <Namespaces>
    <Namespace alias="po" uri="http://www.progress.com/PurchaseOrder"/>
    <Namespace alias="prd" uri="http://www.progress.com/Product"/>
    </Namespaces>
    </Message>
</MessageDescriptor>
* XML template
* Header
* Payload
* Namespace