Creating and editing a test message

To use the Test Client, you must create or edit a test message to send to your message flow.

Before you begin

Complete these tasks before you edit your test message:
  1. Opening the Test Client editor
  2. Configuring the test settings

About this task

A number of editors are available in the Test Client for creating a test message. The most appropriate editor to use depends upon the type of test message you want to send to your message flow.
  • If the input node that you want to send the message to for the test expects an XML message, and the message flow is associated with a message definition, the Edit as XML structure editor is available.
  • If you want to send an XML message, but do not have a message definition defined, or you want to create a test message that is not in XML format, you can use the Edit as text editor.
  • If you want to use an existing test message from a workspace resource or file system file, you can use the Import from external file editor.
  • Alternatively you can import an existing test message into the Edit as text editor, or take the generated source from the Edit as XML structure editor and paste it into the Edit as text editor.

The Test Client provides limited support for the generation of XSD and WSDL test messages. If the Test Client cannot generate the test message automatically, you can create the test message by using either the Edit as text or Import from external file method described in this topic.

Select from the following options to create and edit a test message:

Procedure

  • Edit as XML structure:
    1. In the Events tab of the Test Client, select Edit as XML structure from the Body list.
    2. Edit the entries in the Value column for each field to change the content of the test message.
    3. Right-click the fields in the Edit as XML structure editor to see additional options for defining the content of the test message.
      These options include adding message parts and elements, for example if your message has repeating fields.
    4. You can save your file with the updated test message by clicking File > Save.
    5. To view and copy the generated test message, click Show Generated Source.
  • Edit as text:
    1. In the Events tab of the Test Client, select Edit as text from the Body list.
    2. Enter the text content for your test message. You can copy content into the editor from another source by right-clicking in the editor and selecting Paste, or import content from an existing test message by clicking Import Source.
    3. You can save your file with the updated test message by clicking File > Save.
  • Import from external file:
    1. In the Events tab of the Test Client:
      • If the input node expects an XML message, select Import from external file from the Body list.
      • If the input node does not expect an XML message, select Import from external file (Binary and Text) from the Body list.
    2. Select from the following options to locate the file containing your test message:
      • Workspace resource
        1. Click Workspace. You can then locate your existing test message from your workspace.
        2. Click OK to use the selected resource.
        3. Click Edit to open the default editor associated with the resource.
      • File system file
        1. Click File system. You can then locate your existing test message from your file system.
        2. Click Open to use the selected file.
    3. You can save your file with the updated test message file details by clicking File > Save.

What to do next

Ensure that you have selected the correct input node to send the test message to in your message flow. Click Send Message to send your test message to the selected input node. If this is the first time you have sent a message using this Test Client file, the Deployment Location wizard opens. See Selecting the deployment location for the message flow.