Creating Variable Structures in the XQuery Editors

The Variable Structures palette in the XQuery and XPath editors displays graphical representations of the contents of variables. It includes by default the built-in message context variables attachments, body, header, outbound, and inbound.

Each variable structure mapping entry has a label and maps a variable or variable path to one or more structures. The scope of these mappings is a stage or a route node.

You can also declare your own variable structures, based on:

You can use this feature directly for all user-defined variables, as well as $inbound, $outbound, and $fault. However, you cannot use it directly to access XML attachments in $attachments, headers in $header, or documents and RPC parameters in $body, with one exception- you can use it directly to access documents and parameters in $body for request messages received by a WSDL proxy service.

Before you begin

These instructions assume you are creating or editing an expression in the XQuery Expression Editor, XQuery Condition Editor, or XPath Expression Editor, as described in Creating and Editing Inline XQuery and XPath Expressions.

To create a variable structure:

  1. Select Variable Structures.
  2. In the Variable Structures palette, click Add New Structure.
  3. Continue with any of the tasks listed in Table 20-3, below.
  4. Table 20-3 Create a New Variable Structure 
    To...
    Complete these steps...
    Create a variable structure that maps a variable to an XML Schema type
    1. Select XML Type at the top of the Variable Structures palette, if it is not already selected.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, enter the path of the variable structure at run time. The path must begin with $.
    4. Under the Type field, select the appropriate radio button, then select Schema Type.
    5. Click Browse. The XML Schema Browser is displayed. Select an XML Schema from the list, select an XML Schema type from the Definitions pane, then click Submit.
    6. Click Add to create the variable structure.
    Create a variable structure that maps a variable to a WSDL type
    1. Select XML Type at the top of the Variable Structures palette, if it is not already selected.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, enter the path of the variable structure at run time.
    4. Under the Type field, select the appropriate radio button, then select WSDL Type.
    5. Click Browse. The WSDL Browser is displayed. Select a WSDL from the list of WSDLs, select a WSDL type from the Definitions pane, then click Submit.
    6. Click Add to create the variable structure.
    Create a variable structure that maps a variable to an XML Schema element
    1. At the top of the Variable Structures palette, select XML Type, if it is not already selected.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, enter the path of the variable structure at run time.
    4. Under the Type field, select the appropriate radio button, then select Schema Element.
    5. Click Browse. The XML Schema Browser is displayed. Select an XML Schema from the list, select an XML Schema type from the Definitions pane, then click Submit.
    6. Click Add to create the variable structure.
    Create a variable structure that maps a variable to a WSDL element
    1. At the top of the Variable Structures palette, select XML Type, if it is not already selected.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, enter the path of the variable structure at run time.
    4. Under the Type field, select the appropriate radio button, then select WSDL Element.
    5. Click Browse. The WSDL Browser is displayed. Select a WSDL from the list of WSDLs, select a WSDL element from the Definitions pane, then click Submit.
    6. Click Add to create the variable structure.
    Create a variable structure that maps a variable to a child element
    1. At the top of the Variable Structures palette, select XML Type, if it is not already selected.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, enter the path of the variable structure at run time.
    4. Under the Type field, select the type of variable you want to create:
    5. To create an XML Schema Element or WSDL Element variable, select the radio button associated with this option, then select Schema Element or WSDL Element.

      To create an MFL variable, select the radio button associated with this option, then select MFL.

    6. For the XML Schema, WSDL, or MFL, click Browse to select an object from the list that the browser displays, then click Submit. For example, select an MFL from a list of MFLs, then click Submit.
    7. Select the Set as child check box to set the element as a child of the structure being created.
    8. Click Add to create the variable structure.
    Create a variable structure that uses an MFL resource
    1. At the top of the Variable Structures palette, select XML Type, if it is not already selected.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, enter the path of the variable structure at run time.
    4. Under the Type field, select the appropriate radio button, then click Browse. The MFL Browser is displayed.
    5. Select an MFL from the list of MFLs, then click Submit.
    6. Click Add to create the variable structure.
    Create a Service Interface variable structure
    1. At the top of the Variable Structures palette, select Service Interface.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Path field, the default is already set as $body. You cannot change this field.
    4. In the WSDL Based Service field, select the Service Browser icon, select a service from the list of services the Service Browser displays, then click Submit.
    5. The service you selected is displayed in the WSDL Based Service field.

    6. In the Operation field, select an operation or select None to not include an operation.
    7. Click Add to create the variable.
    Create a Simple variable structure
    1. At the top of the Variable Structures palette, select Simple Type.
    2. In the Structure Label field, enter a display name for the variable you want to create. This display name enables you to give a meaningful name to the structure so you can recognize it at design time but it has no impact at run time.
    3. In the Structure Name field, enter a name for the variable structure you want to create.
    4. Under the Type field, select String or Any XML.
    5. Click Add to create the variable.

After you finish

Continue as described in Creating and Editing Inline XQuery and XPath Expressions.