Creating the message flow
Download the zip file at the bottom of the article and extract the contents into the directory C:\student\DOTNET\lab_msword.
- Assuming that the WebSphere Message Broker Toolkit has not yet been started, from the Start menu,
choose Start => Programs => IBM WebSphere Message Broker Toolkit => IBM WebSphere Message Broker Toolkit 8.0 => WebSphere Message Broker Toolkit 8.0.
You will be asked for the location of a workspace -- the rest of this tutorial assumes that you are using
- Close the Welcome screen and from your empty workspace, launch the Quick Start wizard: Click Start from WSDL and/or XSD, as shown below with the red box.
If you have chosen to use your own existing workspace, you can also launch the Quick Start menu by clicking on the New link at the top of the Broker Development view on the left side of the window:
- The Quick Start wizard requires an application name for the application in which the message flow and Web service definition will be located. Specify the name
App_DotNet_MSWordand click Next:
- On the next panel, select Use external resources and navigate to the artifacts provided in the download file. If you have followed the instructions so far, you will find them in the directory
C:\student\DOTNET\lab_msword. Select the Order.wsdl file, which contains the Web service definition, and then click Next:
- On the final Binding Selection panel, accept the default settings, which will import the
OrderSoapHttpBinding(the WSDL file contains only one binding!). Click Finish:
- When the wizard completes, you will see that a new application that contains the imported WSDL file and the XML schema file that it references. In the next step, you will use the WSDL file
to generate the message flow contents, as described by the pop-up box that the Message Broker Toolkit displays on completing the wizard:
- The message flow file
MyFlow.msgflowshould already be open in the WebSphere Message Broker Toolkit. Drag the WSDL file Order.wsdl and drop it on to the message flow canvas. The Configure New Web Service Usage wizard opens. The WSDL file is used to describe an interface to the flow and expose it as a Web service. Leave all of the default settings and click Finish:
- The Broker Toolkit generates a message flow that has been populated with a SOAP Input node, a SOAP Reply node, and a subflow named
Order. The subflow extracts the body of the SOAP message and places it in the XMLNSC message domain, before returning to the main flow. In its current state, the message flow leaves a gap between the subflow and the SOAP Reply node. It is in this gap that you place a transformation that generates the Microsoft Word document, and also produces a reply message of the correct format, which is passed to the SOAP Reply node to send back to the Web service client:
- Place a .NETCompute node from the Transformation drawer of the flow palette into the message flow between the Order subflow node and the SOAPReply node.
Wire the node terminals as shown below:
- Right-click the .NETCompute node and select Open Microsoft Visual Studio to launch Microsoft Visual Studio, which you will use to develop the C# code
that the .NETCompute node will use to integrate with the logical message tree and create the Microsoft Word document:
You will return to the message flow once you have written and built the C# code in Microsoft Visual Studio.