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:
- To create a new message definition file from a C header file, the header
file must already be present in the workbench,
for example in your message set project. This allows you to select the header
file in the New Message Definition File wizard.
- The wizard allows you to import C header files with .h, .c and .css extensions. If your source file has a different extension you must
rename it before attempting to import it.
- If the message set to which you are adding the new message definition
file does not have an Custom Wire Format (CWF)
layer only the logical information appears in the model. You can add the physical
layer to the message set before or after importing a C header file, but you
should add the physical layer before importing
it to ensure that it is populated with settings from the C header file.
- It is also possible to import a C header file from the command line using mqsicreatemsgdefs.
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:
- Switch to the Broker Application Development
perspective.
- Open the New Message Definition File wizard
by clicking File > New > Message Definition File from
the workbench menu.
- In the displayed list of options, click C header file then
click Next.
- Under Workbench Files,
click the C header file that you want to import.
- 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.
- Click Next.
- 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.
- Optional: If you want to replace the contents
of an existing message definition file:
- Type the name of the existing file in the Message
definition file name field.
- Select the Overwrite the existing file contents without
warning check box. The existing file is overwritten
without a warning being displayed.
- Click Next.
- 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.
- 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.
- 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.
- Optional: Click Finish.
Your new message definition file is immediately created.
- Click Next.
- On the "Import options" page,
specify the physical properties of the new message definition by clicking
the appropriate import options.
- 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:
- Carefully check for any errors in the report that is created when the
file is imported. You can find this report in the log directory
within the project containing the message definition that you have attempted
to create. The report has a .c.report.txt file
extension, prefixed with the name that you specified for the new message definition
file.
- Review the messages shown in the workbench task
list to check whether any new warnings or errors have appeared.