Mediation services: Adding an interface to a node

Interfaces can be added to a component, an import, or an export in the assembly diagram.

WSDL and Java interfaces

The SCA programming model supports WSDL and Java interfaces. All the components have WSDL type interfaces. Only Java components support Java type interfaces in addition to WSDL type interfaces. If a component, import, or export has more than one interface, all the interfaces must be the same type. See "WSDL and Java interfaces and references" and "Adding interfaces" under the related topics for more information.

The Java component, the import without a binding, and the export can have either WSDL or Java interfaces. Note that the mediation flow component can only have a WSDL interface, therefore an export that is wired to a mediation flow component must also have a WSDL interface.

When adding interfaces to these nodes, the Add Interface dialog will allow you to specify the type of interface; 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

For components that require a specific interface type, the options to select WSDL or Java interfaces will not be available as shown in the following Add Interface dialog:

Add Reference dialog

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

Instructions to add the interface

When working in the assembly editor, an interface can be added to a node before it is wired, or you can add the interface during the wiring.

Add the interface before you add the wire

To add an interface to a node before you do the wiring, follow these instructions:

  1. In the assembly editor, click the node so it is selected on the canvas.
  2. Click the Add Interface icon Add Interface icon that appears above the node.

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

    Add Interface dialog

  3. The Add Interface dialog only shows interfaces in the module or dependent libraries and projects. The list of interfaces are displayed in the Matching interfaces container. If available, 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 Matching interfaces container 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. 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 mediation 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.

      A Java interface will open in the Editor view to let you add Java code to complete the interface definition. You can add the code or close the Java editor and complete the coding later.

      A WSDL interface is created without any operations. After the interface has been added to the node, you can open the interface and add its operations.

      Now, you can proceed to finish adding the interface to the node.

  5. In the Add Interface 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. Click OK to finish adding the interface to the node.

Add the interface as you add the wire

You can add wires by using the wire in the palette, dragging the wire handle from the source node or by using the Advanced wiring dialog. As you add a wire from a source node to a target service, you will be prompted if a matching interface and/or reference are to be added. If you click OK, the interface will be created on the target node. See "Wiring nodes" for more information on the wiring actions.

The interface icon, interface icon, on the node, indicates that it has one or more interfaces.

Related tasks
Mediation services: Creating a component
Mediation services: Creating an import
Mediation services: Creating an export
Mediation services: Adding a partner reference
Mediation services: Wiring nodes
Mediation services: Adding more than one wire to a partner reference
Generating bindings for imports and exports
Monitoring events

Related information

Tutorial: Wire components using the assembly editor
Samples: Mediation Flow editor

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