Defining Your Web Service Consumer Mappings

The second page of the Web Service Consumer Wizard enables you to define your mappings for the consumer, as shown in the following image that uses the example Erewhon Investments System provided on the JADE release medium.

The WSDL Definition list box at the left of the Define Mappings page displays the WSDL definition. The corresponding Jade Name Mapping list box at the right displays the JADE classes, methods, and properties that will be imported into your schema.

JADE names that are displayed in the Jade Name Mapping list box in an orange font indicate that the WSDL naming convention is not a valid JADE convention and that has been changed to conform to the JADE naming rules.

You can edit or rename any entity in this list box before you import the Web service consumer class. You can create these classes as subclasses of a class other than Object and you can add or remove prefixes of classes, properties, and methods. You can also change entity names individually, by double-clicking on an entry.

Methods are created against the Web service consumer classes that are imported. These are the methods that can be called from your application.

The WSDL file can also contain enumerations or enumeration lists for primitive properties. As JADE does not have the concept of enumeration, a mapping method is created for these properties. These mapping methods check that when the primitive property is set, it conforms to one (or more than one, for lists) of the values specified in the enumeration. If this is not the case, an exception is raised. The extendedErrorText property in this exception contains the list of valid values.

You can expand all class nodes to show all of their entities or collapse them to show only the class name itself. An expanded node is displayed with a minus sign (-) and a collapsed node that has features displays a plus sign (+). A node that has no entities has no sign. Alternatively, select the Collapse All Classes or Expand All Classes command from the popup menu that is displayed when you right-click in the Jade Name Mapping list box.

To define the mappings for your Web service consumer entities

  1. In the Jade Name Mapping list box at the right of the dialog:

    1. If you want to create the Web service consumer class as a subclass of a superclass other than Object, enter the valid class name in the text box portion of the Superclass Name combo box or select the class from the drop-down list. This applies to all classes listed in the Jade Name Mapping list box, except for the service classes, which are always a subclass of the JadeWebServiceConsumer class.

    2. If you want to apply a prefix to all subclasses, properties, or methods in the imported Web service consumer class, or remove an existing prefix, select the action that you require in the Modifier list box, enter the value in the Value text box, and then click the Modify button. The specified value is then applied to all of the classes, methods, or properties displayed in the Jade Name Mapping list box.

    3. To change the name of a specific entity, double-click on the entity that you want to change. (Alternatively, select the Edit Jade Mapping Name command from the popup menu that is displayed when you right-click on an entity.)

      The entity is then displayed in the editor bar, to enable you to change the name to the required value and then press Enter (if you do not want to change the values of any more entities).

    4. By default, the editor bar is not hidden after each update; that is, the editor bar remains visible after updating an entity so that you can perform multiple edit actions by scrolling up or down the list box by using the up (↑) and down () arrow keys. The List Editor message box is then displayed, prompting you to click the Yes button if you want to update the selected values or the No button if you want to abandon your changes. The editor bar is then positioned on the next entity, and stays visible until you change focus. To hide the display of the editor bar after updating an entity, select the Hide Editor After Each Update command from the popup menu that is displayed when you right-click on an entity.

      You can change the color of the editor bar by double-clicking the colored portion at the left of the editor bar (which is orange by default) and then selecting the color that you require from the common Color dialog that is displayed. When you click the OK button in the Color dialog, the editor bar is then displayed in your selected color.

  2. When you have made all required changes, click the Update button. Alternatively, click the Cancel button to abandon your changes.

The classes, methods, and properties are then created in your schema. Web service consumer classes are always created as subclasses of the JadeWebServiceConsumer class.