This describes how to create a new message definition from an XML
DTD 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 an XML DTD, the DTD file
must already be present in the workbench,
for example in your message set project. This allows you to select the DTD
file in the New Message Definition File wizard.
- If the message set to which you are adding the new message definition
file does not have an XML wire format (XML)
layer only the logical information appears in the model. You can add the physical
layer to the message set before or after importing from a XML DTD, but you
should add the physical layer before importing
it to ensure that it is populated with settings from the XML DTD.
- It is also possible to import an XML DTD from the command line using mqsicreatemsgdefs.
- The file extension must be .dtd in lower case.
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 from an XML DTD:
- 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 XML DTD file to
select it then click Next.
- In the displayed list of workbench files,
click the XML DTD file that you want to import then 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. Your
XML DTD is converted into XML schema and validated.
- In the displayed list of global elements, select
the check boxes for the global elements from which you want to create messages. Use the Select All and Deselect All buttons
at the bottom of the pane to select all global elements in the list or no
global elements in the list.
- Click Finish.
When you have completed importing the XML DTD 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 .dtd.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.
The message definition file is created from the XML DTD and
is opened in the Message Definition editor so that you can check the imported
information and make any required changes. While you are checking the newly
created message definition file, review any messages that appear in the workbench task list to see whether you need to
make any corrections to resolve errors or warnings relating to the new file.