The process of creating Web Services is automated by the Web Service Creation Wizard in the Dynamo Administration UI. This wizard guides you through the steps of selecting a Nucleus component and method, specifying input parameters and other settings; it then automatically creates the Web Service by performing the following steps:

These steps are described in more detail in the Anatomy of a Web Service section.

The wizard uses the component /atg/webservice/WebServiceGenerator to perform the actual work of generating the service. This component, which is of class atg.webservice.
, performs all of the operations listed above, either through its own methods or through other components it refers to.

Using the Wizard

The top-level page of the Dynamo Administration UI includes a Web Service Administration link. This link takes you to the Web Service Administration page, which has three links for working with Web Services:

To create a Web Service that invokes a method on a Nucleus component, starting from the Web Service Administration page:

  1. Click the Web Service Creation Wizard link. This takes you to a page titled Select Type, where you can select the type of Web Service to create.

  2. Click the Component Method Web Service link. This takes you to the Select Nucleus Component page.

  3. On the Select Nucleus Component page, specify the pathname of the Nucleus component you want to create the Web Service from. You can either enter the pathname directly in the field at the top of the page and then click the Next button, or you can use the component browser below it to navigate to the component and select it.

  4. On the Select A Method page, select the method you want to expose as a Web Service.

  5. If the method requires any input parameters, the Set Parameter Names page provides you with fields for specifying the names of these parameters. The names you specify are used for the parameters of the Web Service call, and can be anything you like.

  6. When the Web Service is called, the service passes the values of these parameters to the parameters of the exposed Nucleus method. There is thus a one-to-one correspondence between the parameters of the Web Service call and the parameters of the underlying Nucleus methods.

  7. The next two pages are titled EAR Name & Servlet Settings and Enterprise and Web Application Settings. When the wizard creates a Web Service, it packages it in a WAR file, which is in turn packaged in an EAR file. It is possible to have any number of services in a single Web application (WAR file), and any number of Web applications in a single Enterprise application (EAR file). This flexibility gives you a good deal of control over how you deploy your Web Services. For each new Web Service, the wizard can do any of the following:

    • Create a new EAR file for the service, and put it in a WAR file within the EAR file

    • Use an existing EAR file, and put the service in a new WAR file within it

    • Put the service in an existing WAR file within an existing EAR file

    To add a Web Service to an existing EAR file, you specify that file as the EAR file name on the EAR Name & Servlet Settings page. The Web Application Settings page then gives you the choice of creating a new Web application for the service, or adding the service to an existing Web application.

    The wizard also gives you the option of specifying the host name and port number for a Web Service, or of leaving these fields blank. If you leave the fields blank, the values are dynamically assigned at runtime from the URL used for the WSDL file request.

  8. The Session & Security Options page allows you to specify whether the Web Service should be executed within the context of an HTTP session. The wizard gives you these options:

    • Neither provide a session nor security constraints

    • Provide a session, but no security constraints

    • Provide both a session and security constraints

    If you want to call the Web Service from a client that uses sessions or session sharing, you must choose one of the last two options. If you choose the last option, the wizard then prompts you to select a security configuration. See Web Service Security for information about security configurations for Web Services.

  9. On the Create EAR File page, click the Create EAR File button to create the Web Service. If there is already an EAR file with the specified name, the wizard first appends .old to the name of the existing file so that new file does not overwrite it.

Once you have created an EAR file, you must deploy it in order to run the Web Services in it. See the Deploying Web Services section for more information.

Naming Restrictions

Most of the class names and filenames for Web Services are generated automatically by the wizard. As a result, certain circumstances can result in naming conflicts. For example, if you create a Web Service from a Nucleus method, you cannot then create a second Web Service from another method with the same name (such as an overloaded method) and put it in the same WAR file, even if the two methods have different signatures or capitalization. If you attempt to do this, the second Web Service simply overwrites the first.

To prevent the second service from overwriting the first, put the second service in a different WAR file. In addition, be sure to give the second WAR file a different context root from the first WAR file. (The default value for the context root in the wizard is based on the method name, so you will need to change the value when you run the wizard.) It is then be possible to differentiate calls to the two services based on their context roots.

Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices