このサンプルをインポートしてデプロイすると、以下のサンプルの実行の手順に従ってサンプルを実行できます。
入力テスト・メッセージの例と、それに対応する出力メッセージ (1 つは HTTPReply ノードによって生成され、もう 1 つは FileOutput ノードによって生成される) も示されているため、サンプルが機能したことを確認できます。
サンプルの実行時に問題を検出した場合は、 WebSphere Message Broker 資料の『サンプル実行時の問題の解決』を参照してください。
このサンプルを実行する際に使用されるテスト・メッセージは、売上送り状を表す SOAP メッセージです。 このメッセージは、以下のフォーマットに基づいています。
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:samp="http://www.samplemessage.broker.hursley.ibm.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<samp:SaleListMessage>
<SaleEnvelope>
<Header>
<SaleListCount>1</SaleListCount>
</Header>
<SaleList>
<Invoice>
<Initial>K</Initial>
<Initial>A</Initial>
<Surname>Braithwaite</Surname>
<Item>
<Code>00</Code>
<Code>01</Code>
<Code>02</Code>
<Description>Twister</Description>
<Category>Games</Category>
<Price>00.30</Price>
<Quantity>01</Quantity>
</Item>
<Item>
<Code>02</Code>
<Code>03</Code>
<Code>01</Code>
<Description>The Times Newspaper</Description>
<Category>Books and Media</Category>
<Price>00.20</Price>
<Quantity>01</Quantity>
</Item>
<Balance>00.50</Balance>
<Currency>Sterling</Currency>
</Invoice>
<Invoice>
<Initial>T</Initial>
<Initial>J</Initial>
<Surname>Dunnwin</Surname>
<Item>
<Code>04</Code>
<Code>05</Code>
<Code>01</Code>
<Description>The Origin of Species</Description>
<Category>Books and Media</Category>
<Price>22.34</Price>
<Quantity>02</Quantity>
</Item>
<Item>
<Code>06</Code>
<Code>07</Code>
<Code>01</Code>
<Description>Microscope</Description>
<Category>Miscellaneous</Category>
<Price>36.20</Price>
<Quantity>01</Quantity>
</Item>
<Balance>81.84</Balance>
<Currency>Euros</Currency>
</Invoice>
</SaleList>
<Trailer>
<CompletionTime>12.00.00</CompletionTime>
</Trailer>
</SaleEnvelope>
</samp:SaleListMessage>
</soap:Body>
</soap:Envelope>
このサンプルは、メッセージ・フロー FileOutputNodeSampleFlow を使用します。
サンプルを実行するには、次のようにします。
上記のステップがすべて正常に完了したら、サンプルは完了です。 メッセージ・フロー FileOutputNodeSampleFlow 内のノードを調べて、どのように結果が生じたかを確認します。
HTTPReply ノードからの出力メッセージは入力メッセージと類似していますが、以下の 3 つの点で更新されています。
以下のコードは予想されるメッセージを示しています。読みやすくするために復帰を使用してフォーマット設定しています。
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:samp="http://www.samplemessage.broker.hursley.ibm.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<samp:SaleListReplyMessage>
<SaleEnvelope>
<Header>
<SaleListCount>1</SaleListCount>
</Header>
<SaleList>
<Invoice>
<Initial>K</Initial>
<Initial>A</Initial>
<Surname>Braithwaite</Surname>
<Item>
<Code>00</Code>
<Code>01</Code>
<Code>02</Code>
<Description>Twister</Description>
<Category>Games</Category>
<Price>00.30</Price>
<Quantity>01</Quantity>
</Item>
<Item>
<Code>02</Code>
<Code>03</Code>
<Code>01</Code>
<Description>The Times Newspaper</Description>
<Category>Books and Media</Category>
<Price>00.20</Price>
<Quantity>01</Quantity>
</Item>
<Balance>00.50</Balance>
<Currency>Sterling</Currency>
</Invoice>
<Invoice>
<Initial>T</Initial>
<Initial>J</Initial>
<Surname>Dunnwin</Surname>
<Item>
<Code>04</Code>
<Code>05</Code>
<Code>01</Code>
<Description>The Origin of Species</Description>
<Category>Books and Media</Category>
<Price>22.34</Price>
<Quantity>02</Quantity>
</Item>
<Item>
<Code>06</Code>
<Code>07</Code>
<Code>01</Code>
<Description>Deluxe Microscope</Description>
<Category>Miscellaneous</Category>
<Price>44.00</Price>
<Quantity>01</Quantity>
</Item>
<Balance>81.84</Balance>
<Currency>Euros</Currency>
</Invoice>
</SaleList>
<Trailer>
<CompletionTime>12.00.00</CompletionTime>
</Trailer>
</SaleEnvelope>
</samp:SaleListReplyMessage>
</soap:Body>
</soap:Envelope>
FileOutput ノードからの出力メッセージは入力メッセージと類似していますが、以下の 3 つの点で更新されています。
以下のコードは予想されるメッセージを示しています。読みやすくするために復帰を使用してフォーマット設定しています。
<?xml version="1.0" encoding="UTF-8"?>
<NS1:SaleListReplyMessage xmlns:NS1="http://www.samplemessage.broker.hursley.ibm.com">
<SaleEnvelope>
<Header>
<SaleListCount>1</SaleListCount>
</Header>
<SaleList>
<Invoice>
<Initial>K</Initial>
<Initial>A</Initial>
<Surname>Braithwaite</Surname>
<Item>
<Code>00</Code>
<Code>01</Code>
<Code>02</Code>
<Description>Twister</Description>
<Category>Games</Category>
<Price>00.30</Price>
<Quantity>01</Quantity>
</Item>
<Item>
<Code>02</Code>
<Code>03</Code>
<Code>01</Code>
<Description>The Times Newspaper</Description>
<Category>Books and Media</Category>
<Price>00.20</Price>
<Quantity>01</Quantity>
</Item>
<Balance>00.50</Balance>
<Currency>Sterling</Currency>
</Invoice>
<Invoice>
<Initial>T</Initial>
<Initial>J</Initial>
<Surname>Dunnwin</Surname>
<Item>
<Code>04</Code>
<Code>05</Code>
<Code>01</Code>
<Description>The Origin of Species</Description>
<Category>Books and Media</Category>
<Price>22.34</Price>
<Quantity>02</Quantity>
</Item>
<Item>
<Code>06</Code>
<Code>07</Code>
<Code>01</Code>
<Description>Deluxe Microscope</Description>
<Category>Miscellaneous</Category>
<Price>44.00</Price>
<Quantity>01</Quantity>
</Item>
<Balance>81.84</Balance>
<Currency>Euros</Currency>
</Invoice>
</SaleList>
<Trailer>
<CompletionTime>12.00.00</CompletionTime>
</Trailer>
</SaleEnvelope>
</NS1:SaleListReplyMessage>