Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Using Microsoft .NET in WebSphere Message Broker V8: Part 3: Integrating with Microsoft Excel

Ben Thompson (bthomps@uk.ibm.com), Consulting IT Specialist, IBM
Author photo
Ben Thompson is a Consulting IT Specialist working on the WebSphere Message Broker development team at the IBM Hursley Software Lab in the UK. He is currently working on the design and implementation of .NET support in Message Broker. In the past, he has worked for IBM Software Services for WebSphere designing and implementing WebSphere solutions for IBM customers worldwide. You can contact Ben at bthomps@uk.ibm.com.
(An IBM developerWorks Contributing Author)
Matthew Golby-Kirk (mgk@uk.ibm.com), Software Developer, IBM
Matthew Golby-Kirk photo
Matthew Golby-Kirk is a software developer working on the WebSphere Message Broker development team at the IBM Hursley Software Lab in the UK. He works on the design and implementation of the HTTP and Web services support, along with the ESQL language run time in WebSphere Message Broker. You can contact Matthew at mgk@uk.ibm.com.

Summary:  This series of four tutorials demonstrates the new support for Microsoft .NET in WebSphere Message Broker V8. Part 3 describes integration with Microsoft Excel. Readers should be familiar with either Microsoft .NET or WebSphere Message Broker but need not be familiar with both.

View more content in this series

Date:  01 Feb 2012
Level:  Intermediate

Comments:  

Preparation and deployment to Message Broker

Having built an assembly file from the C# code, you can drag and drop the assembly file from a Windows Explorer window directly onto the message flow canvas in order to create a .NETCompute node that is associated with the assembly file's code. This technique results in a hard-coded, absolute location for the assembly (set to the location that you dragged from), and is intended as a quick method when developing, testing, and hot-swapping the .NET code that the Broker is executing. For production situations, a more typical approach is to define a Message Broker Configurable Service that specifies to a .NETCompute node where to locate the assembly file. Here is the drag and drop technique for the configuration of the current scenario:

  1. To prepare for the drag and drop, return to the WebSphere Message Broker Toolkit, where the message flow MyFlow.msgflow that you created earlier should still be open. Open a Windows Explorer window in front of the Toolkit and navigate to the location where you built the assembly file in the previous section. If you have followed the default naming so far, the location will be:
    C:\student\DOTNET\lab_msexcel\visual studio 2010\Projects\MSExcelDotNetProject\
    MSExcelDotNetProject\bin\Debug\MSExcelDotNetProject.dll
    

    Drag and drop the assembly on top of the .NETCompute node in the flow, as shown by the red arrow:



    Drag and drop assembly to configure the .NETCompute node
  2. Wire up the Out terminal of the FileInput node to the In terminal of the .NETCompute node. Also wire the Out terminal of the .NETCompute node to the In terminal of the FileOutput node. The message flow should now look like this:

    Wired up message flow
  3. Inspect the properties of the .NETCompute node and you should see that the Assembly name property has now been configured, as shown below. Save the message flow by pressing Ctrl-S:

    Assembly name property of the .NETCompute node
  4. Select the FileInput node and inspect its properties. On the Basic properties panel, set the Input directory to be C:\student\DOTNET\lab_msexcel\input and set the File name or pattern to be *.xml. These properties mean that the message flow will start whenever a file with the extension .xml is found in the above directory. Here are the Basic node properties:

    Basic properties panel of the File Input node
    Switch to the Input Message Parsing properties panel and set the Message Domain property (you can use the drop-down) to the value XMLNSC : For XML messages (namespace aware, validation, low memory use). This setting means that the message flow will expect inbound files to contain well-formed XML, and will construct the logical message tree using the broker's XMLNSC parser. If you wished, you could specify a particular message model (XML schema) to which inbound data should conform, but for the purposes of this tutorial, just specify the XMLNSC message domain so that any XML document can be used to test the scenario. Here are the Input Message Parsing node properties:

    Input Message Parsing properties panel of the File Input node
  5. Select the FileOutput node and inspect its properties. On the Basic properties panel, set the Directory to be C:\student\DOTNET\lab_msexcel\output and set the File name or pattern to be *.xml . The output file name used by the node will be the same as the input file name, because the .NETCompute node copies the LocalEnvironment tree, which provides a dynamic override for the file name. Here are the Basic node properties:

    Basic properties panel of the File Output node
  6. Save the message flow.
  7. Before deploying the message flow, using a Windows Explorer window, create the file directories that it uses to read input files and write output files:

    C:\student\DOTNET\lab_msexcel\input
    C:\student\DOTNET\lab_msexcel\output

    The image below shows the C:\student\DOTNET\lab_msexcel directory after the two subdirectories have been created:

    Windows explorer directory creation
  8. This tutorial assumes that you have already set up a runtime broker using the default configuration, which provides a message broker named MB8BROKER. For more information on the default configuration, see Creating the Default Configuration in the Message Broker information center.
  9. In order to deploy the application containing the message flow that you created, simply drag and drop it onto a runtime execution group, such as the default configuration shown below. The red arrow shows the drag and drop movement:

    Application deployment via drag and drop

The next section of the tutorial shows you how to test the scenario.

5 of 9 | Previous | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=791518
TutorialTitle=Using Microsoft .NET in WebSphere Message Broker V8: Part 3: Integrating with Microsoft Excel
publish-date=02012012
author1-email=bthomps@uk.ibm.com
author1-email-cc=
author2-email=mgk@uk.ibm.com
author2-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).