Mediation services: Adding a partner reference

The partner reference of a component or a stand-alone reference specifies the interface that is used in the invocation of another service.

WSDL and Java interfaces in partner references

The implementation type of the component determines the type of interface that its partner references can have. Mediation flow components can only have WSDL interfaces in their partner references. The Java component and the stand-alone reference can have either a WSDL or Java interface in its partner reference. In this case, the Add References dialog will allow you to specify the type of interface that will be used for the partner reference; that is, you will have a set of radio buttons for Show WSDL and Java, Show WSDL, and Show Java options, as shown in the following image:

Add Reference dialog

If Java interface is not supported for the partner reference, the Add Reference dialog will not have the options to select WSDL or Java interfaces, as shown in the following image:

Add Reference dialog

The instructions in this topic assumes that you have a choice in selecting either a WSDL or Java interface for the partner reference.

Instructions to add the partner reference

When working with the assembly editor, a partner reference can be added to the node before you wire it to a target node, or the partner reference can be added during the wiring.

Add the partner reference before you add the wire

To add a partner reference to a component or stand-alone references before you do the wiring, follow these instructions:

  1. In the assembly editor, click the component or stand-alone references so that it is selected on the canvas.
  2. Click the Add Reference icon, Add Reference icon, that appears above the component.

    The Add Reference dialog is opened. The following image shows the dialog:

    Add Reference dialog

    The partner reference specifies the interface that is used in the invocation of the other component; the Add Reference dialog lets you select the interface that will be used.

  3. The Add Reference dialog only shows interfaces in the module or dependent libraries and projects. The list of interfaces are displayed in the Matching interfaces container. To see Java interfaces, select the Show Java or the Show WSDL and Java option.
  4. Start to type the name of the interface in the filter field, and interfaces will appear in the wizard for you to select.

    If the interface does not exist, follow these instructions to create the interface and then you can make your selection in the dialog.

    1. Click the New... button.
      Note: If you have selected Show WSDL and Java, a message asks which type of interface you want to create. Select the type you want and click OK.
    2. In the Create New Interface wizard, specify the module (or library) to indicate where the new interface is to be added and a name for the interface. Depending if the interface is a Java or WSDL interface, you may need to specify different information; use the Tab key to focus on the field or button and press the F1 key (Ctrl+F1 for Linux) to get additional help to complete the information in the wizard.
    3. Click Finish to create the new interface. For the Java interface, it will be opened in the Editor view to let you added Java code to complete the interface definition. You can add the code or close the Java editor and complete the coding later.

      For the WSDL interface, it is created without any operations. After the partner reference has been added to the stand-alone references or component, you can open the interface and add its operations.

      Now, you can proceed to finish adding the partner reference to the node.

  5. In the Add Reference dialog, select the interface in the Matching interfaces container. The fully-qualified file that has the interface is shown in the Qualifier container. If there is more than one interface with the same name, make sure that you select the right file in the Qualifier container.
  6. Select the interface and click OK to finish the creation of the partner reference.

Every reference on the node is represented by a reference icon, reference icon, 1..1 on the right side of the component. By default, a newly created reference has multiplicity setting of 1..1 which means that it must have exactly one wire going to a target service. See related tasks for more information on adding more than one wire to a reference.

Add the partner reference as you add the wire

You can add wires by using the wire in the palette or dragging the wire handle from the source node. As you add a wire from a component or stand-alone references to a target service (which is either a component or import), you will be prompted if a matching partner reference is to be added to the source node. If you answer OK, the reference will be created on the source component or stand-alone references.

Also, you can invoke the Advanced wiring dialog to do the wiring. There is a New Reference button in the dialog to let you add a new partner reference before doing wiring. See "Wiring nodes" under related tasks for more information on advanced wiring.

Related tasks
Mediation services: Creating a component
Mediation services: Creating an import
Mediation services: Creating an export
Mediation services: Adding an interface to a node
Mediation services: Wiring nodes
Mediation services: Adding more than one wire to a partner reference

Feedback
(C) Copyright IBM Corporation 2005, 2006. All Rights Reserved.