Show TOC

Managing Service InterfacesLocate this document in the navigation structure

Use

In the Service Interface Editor (SIE), you can create from scratch simple service interfaces or services. Note that they contain only the basic attributes of a service interface or a service. You later can modify these attributes and add new ones. You use the service creation wizard to create new interfaces, operations and parameters. You can start the wizard from different tools and perspectives in the Developer Studio. Depending on the context in which the wizard is called, it is initially filled with default values if such are available. When you create a new WSDL document stored in a chosen location, the document contains a sample skeleton of WSDL definition which gives you a quick start in the modeling (one operation with one input parameter and one output parameter, both of type string). Next, you can edit the service interface by renaming, removing or copying one or more of its elements.

You can modify existing service interfaces and their XSD schemas by editing, deleting and/or renaming their elements and details. You can modify a service interface that you created from scratch or a back-end service you downloaded and saved locally.

In the Data Types tab page of the SIE, you can edit and define data types and the relation between them. You can create new namespaces in the XSD schema or edit existing ones. Furthermore, you can reuse and copy data types between different namespaces.

All changes you make in the Service Interface or the Data Types tab page are immediately reflected in the source code of the service interface. You can:

  • Edit service interfaces, service operations, parameters, and faults.

  • Delete elements of the service interface.

  • Add namespaces to the XSD schema of a service interface.

  • Edit the data types in the XSD schema of a service interface.

  • Copy element and data types between different namespaces.

You can thus customize your service interface by adding or removing elements, so that it is suitable for your needs.

Note

You have the option to undo or redo your actions.

Prerequisites

You need to either:

Procedure

Creating a Service Interface

  1. From the menu path, choose Start of the navigation path File Next navigation step New Next navigation step Other Next navigation step Web Services End of the navigation path. Expand the node and choose WSDL .

  2. In the dialog that appears specify the details for the service interface that you want to create.

    Select the development component and the exact folder in which you want to store the new service interface. Optionally, you can change the WSDL file default name. Choose the Next pushbutton.

  3. Optionally, you can change the target namespace. You can also choose:

    • Whether to create a WSDL skeleton

    • Whether to use SOAP or HTTP protocol

    • What binding options to use

      For more information on protocols and binding options, see the WSDL specifications: www.w3c.org

  4. Choose the Finish pushbutton.

Editing a Service Interface

  1. From your project tree, select the WSDL file you want to edit. From the context menu, choose Start of the navigation path Open with Next navigation step Other Next navigation step Service Interface Editor End of the navigation path. In case the SIE is your default editor, double click the WSDL file.

  2. Select the element you want to edit. In the General and Documentation sections, edit the name, type or documentation properties of the element.

  3. To delete an attribute, select it and choose the Remove pushbutton or choose it from the context menu.

    You can use multiple selection of attributes by pressing and holding the Ctrl key and selecting the attributes you want to delete.

  4. To edit the data types in an attribute, click the Type: link in the details view of the selected parameter.

    You can also edit data types by opening the Data Types tab page in the SIE

Adding a Service Operation

When you create a new service operation in your service interface, the WSDL definition of the service operation contains input and output parameter, which you need to define. In addition, you can change the service operation type. In the General view, you can choose from the two service operation types in accordance with the service operation structure you need:

  • ASYNCHRONOUS - the client invoking the service does not wait for a response.

  • REQUEST_RESPONSE - the client invoking the service requires a response to the request.

If the SIE is not your default editor, from the WSDL file context menu choose Start of the navigation path Open With Next navigation step Other End of the navigation path and from the list with editors, choose the Service Interface Editor .

To create a new service operation:

  1. In your project tree, navigate to the folder, in which the WSDL you want to edit is located. Select the service and double-click it to open it with the SIE.

    Note

    To open a WSDL file directly with the SIE, you need to configure it as your default editor. For more information, see Modeling Services with the Service Interface Editor .

  2. In the Service Interfaces window, choose the Add Operation pushbutton or choose it from the context menu.

  3. In the Name field, type an appropriate name for the operation. In the Documentation field, type any information about the operation you want the user to read.

Adding Parameters

Depending on the structure of your service operation, you can add one or more input and/or output parameters.

  1. Select the service operation in which you want to add a parameter.

  2. To add an input parameter, choose the Add Input Parameter pushbutton or select it from the context menu.

  3. To add an output parameter, choose the Add Output Parameter pushbutton or select it from the context menu.

    Note

    If your service operation is of ASYNCHRONOUS type, you can add only input parameters.

  4. You can do the following:

    • Specify an appropriate name for the parameter you have added.

      Note

      The SIE defines a default name for your new parameter. In case you define an invalid name for your parameter, i.e. it is duplicated, an error marker is displayed. You can see a description of the error in the Problems view of the Developer Studio.

    • Change the type of the parameter by choosing from list in the dropdown menu.

    • Change the type of the parameter by choosing the Browse pushbutton. You can:

      • Choose from the list of the parameter types, contained in the current XSD schema

      • Filter your search scope by choosing whether you want to search for parameter types in your open WSDL file ( Current Resource ), all XSD schemas and WSDL files in the current project ( Enclosed Project ) or in the whole workspace ( Workspace ). You can also search in workspaces you previously created.

    • Create a new parameter type by choosing the New pushbutton.

      • Choose a type category for the parameter type.

      • Enter a valid and unique name for the parameter type.

    • In the Documentation field, add any information about the parameter that you want the user to see

Note

Click on the Type: link to open the Data Types Editor. For more information, see Managing Data Types .

Adding Faults

You can define a fault for exceptions that occur during the service execution. To add a fault and fault description:

  1. Select the service operation in which you want to add a fault.

  2. Choose Add Fault or select it from the context menu. You can define an appropriate name for the fault and in the Documentation field, add any information you want the user to see.

Editing Data Types

  1. Open the Data Types tab page ofthe SIE.

  2. To create a new namespace, choose the Add Namespace pushbutton and define its name.

  3. Select the element you want to edit. In the General and Documentation sections, edit the name, type or documentation properties of the element.

    For detailed information on adding and editing data types, see Managing Data Types .

Copying Elements and Data Types

You can easily copy to another namespace data types or element by selecting the element and choosing Copy from the context menu. You can copy one element at a time and paste it in any other namespace by selecting it and choosing Paste in its context menu. You can use multiple selection of elements by pressing and holding the Ctrl key and selecting the elements you want to copy.