Linking from one message definition file to another

Before you start:

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

There are two possible ways to link one message definition file to another: you can either add an include or you can add an import for the file that you want to reference.

When you are working with a message definition file, you can check which other message definition files this file currently includes or imports by carrying out the steps listed below:

  1. Open the message definition file in the Message Definition editor.
  2. In the Outline view, in the displayed hierarchy, select the .mxsd file.
  3. In the Properties Hierarchy, expand Imports or Includes as appropriate to display a list of the other files that the currently selected file includes or imports.

Include

You use the include option if you want to link to a message definition file with the same namespace, or if you want to link a message definition file with no target namespace to a message definition file with a target namespace (chameleon behavior). You must also choose to add an include rather than an import if you want to link a message definition file with no target namespace to another message definition file that also has no target namespace.

Note: A message definition file can only reference objects in another message definition file if this other file has been included directly, so you might have a problem if you try to use the include option to include message definition files that are themselves included within other message definition files. For information about ways of resolving this situation, see Resolving problems when developing message models.

This task assumes that you have opened an existing message definition file.

To add an include to a message definition file:

  1. Switch to the Broker Application Development perspective.
  2. Ensure that the Outline view is visible in the Broker Application Development perspective of the workbench. If the Outline view is not visible, from the workbench menu, click Window > Show View > Outline.
  3. In the Outline view, click the message definition (.mxsd) file name.
  4. Display the Properties tab of the Message Definition Editor by clicking Properties in the bottom left corner of the editor area.
  5. In the Properties Hierarchy, right-click Includes then click Add Include on the pop-up menu. The "Select Message Definition file to include" window opens.
  6. In the Message Sets pane, select the message definition file that you want to include. If the message definition files within your project are not visible in this pane, expand the project hierarchy by clicking +.
  7. Click Finish. The message definition file that you selected in step 4 is included within the message definition file that you opened before beginning this task.

Import

You use the import option if you want to link a message definition file to another message definition file in a different namespace. You cannot add an import from the same namespace; this includes linking from a message definition file with no target namespace to another message definition file with no target namespace.

To add an import to a message definition file:

  1. Switch to the Broker Application Development perspective.
  2. Ensure that the Outline view is visible in the Broker Application Development perspective of the workbench. If the Outline view is not visible, from the workbench menu, click Window > Show View > Outline.
  3. In the Outline view, click the message definition (.mxsd) file name.
  4. Display the Properties tab of the Message Definition editor by clicking Properties in the bottom left corner of the editor area.
  5. In the Properties Hierarchy, right-click Imports then click Add Import on the pop-up menu. The "Select Message Definition file to import" window opens.
  6. In the Message Sets pane, select the message definition file that you want to import from the workspace. If the message definition files within your project are not visible in this pane, expand the project hierarchy by clicking +.
  7. Click Finish. The message definition file that you selected in step 4 is imported into the schema of the message definition file that you opened before beginning this task.