Chapter 8 Working with Web Services


Creating a Web service with the wizard

You can create a Web service with the wizard that will guide you through the creation of the component. The wizard is invoked from a class diagram and is only available if you use the Java or the .NET family.

You can either create a Web service without selecting any class, or use the standard approach that consists in selecting an existing class first and then start the wizard from the contextual menu of the class.

You can also create several Web services of the same type by selecting several classes at the same time. The wizard will automatically create one Web service per class. The classes you have selected in the class diagram become Web service classes, they are renamed to match the naming conventions standard, and they are linked to the new Web service component.

Note   Using a namespace
You must create the Web service component within a package so that the package acts as a namespace.

The wizard for creation of Web services lets you define the following parameters:

Property Description
Name Name of the Web service component
Code Code of the Web service component
Web service type Interface or Implementation. Interface refers to a component that defines the service interface only. Implementation refers to a component that implements a service interface
Component type The component type depends on the web service type. You can select among a list of web service interface or implementation protocols
Web service implementation class Defines the class that is used to implement the Web service
Create symbol Creates a component symbol in the diagram specified beside the Create symbol In check box. If a component diagram already exists, you can select one from the list. You can also display the diagram properties by selecting the Properties tool
Create Class Diagram for component classifiers Available only for stateless session beans and servlets. It creates a class diagram with a symbol for each class and interface. If you have selected classes and interfaces before starting the wizard, they are used to create the component. This option allows you to display these classes and interfaces in a diagram

Steps To create a Web service with the wizard:

  1. Select Tools→Create Web Service Component from a class diagram.

    The Web Service Wizard dialog box is displayed.
  2. Type a name and code for the Web service component and click Next.

    Note   Steps of the wizard
    If you have selected classes before starting the wizard, some of the following steps are omitted because the different names are created by default according to the names of the selected classes.



    When you create a Web service with the wizard, you have to select the type of the Web service and the type of the component that is used as a source. The following table maps available component types to Web service types in Java:
    Component type Java service interface Java service implementation
    Use
    Standard   Java class
    Axis RPC   Java class
    Axis EJB   EJB Stateless Session Bean
    Java Web Service (JWS)   Java class with .jws extension
    JAXM   Java Servlet
    JAX-RPC   Java class
    Web Service for J2EE   EJB Stateless Session Bean


    = allowed

    — = not allowed
  3. Select a Web service type and a component type and click Next.
  4. Select a Web service implementation class and click Next.
  5. At the end of the wizard, you have to define the creation of symbols.

When you have finished using the wizard, the following actions are executed:

 


Copyright (C) 2006. Sybase Inc. All rights reserved.