Importing from C

This describes how to create a new message definition from a C header file using the New Message Definition File wizard in the workbench.

Before you start:

To complete this task, you must have completed the following tasks:

Before you begin this task, you should be aware of the points listed below:

If you previously used the WebSphere MQ Integrator Version 2.1 C importer to create a message model, you may find that the WebSphere Business Integration Message Broker Version 5.0 importer does not produce exactly the same results. In particular, the Version 2.1 C importer did not support as many C constructs as WebSphere Business Integration Message Broker Version 5.0, and the naming convention for Version 2.1 compound types is not the same as the naming convention for WebSphere Business Integration Message Broker Version 5.0 complex types and groups. In a very few cases, the naming convention for Version 2.1 elements is not the same as the naming convention for WebSphere Business Integration Message Broker Version 5.0 elements.

The following steps cover both creating a completely new message definition file and overwriting the contents of an existing file.

To create a message definition file from a C header file:

  1. Switch to the Broker Application Development perspective.
  2. Open the New Message Definition File wizard by clicking File > New > Message Definition File from the workbench menu.
  3. In the displayed list of options, click C header file then click Next.
  4. Under Workbench Files, click the C header file that you want to import.
  5. Optional: Should your C header file have any definitions that need including, it may be necessary to specify the path for them. Under Include Path, define any include path needed to ensure that the C data structure is imported correctly.
  6. Click Next.
  7. In the list of message sets shown under Message sets, click the target message set for the message definition file that you are creating. The Message definition file name field is automatically filled in with a default file name, based on the name of the file that you are importing. If required, you can change the displayed default file name to a new name of your choice.
  8. Optional: If you want to replace the contents of an existing message definition file:
    1. Type the name of the existing file in the Message definition file name field.
    2. Select the Overwrite the existing file contents without warning check box. The existing file is overwritten without a warning being displayed.
  9. Click Next.
  10. Under Source Structures, select the check boxes for the source structures that you want to import then add your selections to Imported structures. Use the >, <, >> and << buttons to select individual structures or all structures and add them to or delete them from Imported Structures.
  11. Under Imported structures, select those structures that you want to be messages in the message definition file. Either click Select All or click the structures individually.
  12. Optional: Type a name prefix to be added to all the imported global complex types and groups created during the import. Adding a prefix helps to avoid the possible duplication of names.
  13. Optional: Click Finish. Your new message definition file is immediately created.
  14. Click Next.
  15. On the "Import options" page, specify the physical properties of the new message definition by clicking the appropriate import options.
  16. Click Finish. The message definition is created from the C header file and is opened in the Message Definition editor so you can check the imported information and make any required changes. To check the contents of the message definition file, including any other message definition files included or imported by this message definition file, click the .mxsd file in the Outline view.

When you have completed importing the C header file using the wizard:

Related concepts
Ways to create message definitions
Importing from other model representations to create message definitions
Related tasks
Working with a message set project
Importing from the command line
Adding a Custom Wire Format (CWF)
Related reference
Import formats
Importing from C: supported features