The message flow used in this example illustrates how to add a namespace to a message. The input message does not contain any elements that use a namespace.
Use the instructions in this topic to run the sample. These instructions include an example of an input test message and the corresponding expected output message. Use the expected output message to confirm that the sample has worked.
If you encounter any problems when you run the sample, see Resolving problems when running samples in the WebSphere Message Broker documentation.
The test message that you use to run this sample is based on the following format:
<?xml version="1.0" encoding="UTF-8"?> <SaleListMessage> <SaleEnvelope> <Header> <SaleListCount>1</SaleListCount> </Header> <SaleList> <Invoice> <Initial>K</Initial> <Initial>A</Initial> <Surname>Braithwaite</Surname> <Item> ... </Item> <Balance>81.84</Balance> <Currency>EUR</Currency> </Invoice> </SaleList> <Trailer> <CompletionTime>2000-01-01 00:00:01.000000</CompletionTime> </Trailer> </SaleEnvelope> </SaleListMessage>
This sample uses the message flow called ADDNAMESPACEMF.
To run the sample:
The message flow parses the XML message and writes out an XML message that use namespaces. The output message is put to the ADDNAMESPACEMF.OUT queue.
If all the steps are successful, then the sample is complete.
The expected output XML message is:
<?xml version="1.0" encoding="UTF-8"?> <NS1:SaleListMessage xmlns:NS1="http://www.samplemessage.brokertest.hursley.ibm.com"> <SaleEnvelope> <Header> <SaleListCount>1</SaleListCount> </Header> <SaleList> <Invoice> <Initial>K</Initial> <Initial>A</Initial> <Surname>Braithwaite</Surname> <Item> ... </Item> <Balance>81.84</Balance> <Currency>EUR</Currency> </Invoice> </SaleList> <Trailer> <CompletionTime>2000-01-01 00:00:01.000000</CompletionTime> </Trailer> </SaleEnvelope> </NS1:SaleListMessage>