Business services: Adding an interface

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" under the related topics for more information.

The component that does not have an implementation type, the Java component, the import without a binding, the export, and the selector can have either WSDL or Java interfaces. 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 the other components that require a specific interface type, the options to select WSDL or Java interfaces are not be available, as shown in the following Add Interface dialog:

Add Reference dialog

The instructions in this topic assume that you have a choice in selecting either a WSDL or Java interface.

Instructions to add the interface

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

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 opens. 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. 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 you want to use 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 a module or library where the new interface is to be added and provide a name for the interface. Depending whether 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.

  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, by dragging the wire handle from the source node, or by using the Advanced wiring dialog. As you add a wire from a source to a target, 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 concepts
Business services: Using Java
SCA to Java bridge
Business services: Top-down development
Business services: Bottom-up development
Business services: Meet-in-the-middle development
Related tasks
Business services: Creating a component
Business services: Creating an import
Business services: Creating an export
Business services: Adding a partner reference
Business services: Wiring nodes
Business services: Adding more than one wire to a partner reference
Business services: Generating bindings for imports and exports
Monitoring events
Related reference
Best practices: Modules and packaging for business services

Related information

Samples: Assembly editor for business services
Tutorial: Wire components using the assembly editor

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