EGL Reference Guide for iSeries

Creating an EGL Web service

An EGL Web service is a set of operations with these characteristics:

For a description of the components of a Web service and the uses of a Web service definition file, see EGL Web service.

Before you can create an EGL Web service, you must have access to one or more EGL files (extension .egl) that each contains a program. Any program may be incomplete, but the parameters must be fully specified.

To create an EGL Web service, do as follows:

  1. Click File > New > Other; and at the New screen, click Web Services, then Web Service, then Next
  2. Work through the pages of the EGL Web service wizard:

For background information, review material on Web services, including these help topics:

Web Services page

Do as follows at the Web Services page:

  1. In the list box for Web service type, select EGL Web Service
  2. If you want to test the Web service in the WebSphere Test Environment, select the check box for Start Web service in Web project
  3. If you intend to publish the Web service to a Universal Description, Discovery, and Integration (UDDI) directory, select the check box for Launch the Web Services Explorer
  4. To generate a Java proxy for client-side access of the EGL Web service, select the check box for Generate a proxy; you need the proxy to test the Web service in the WebSphere Test Environment.
  5. If you want to test the proxy, you also need to select the check box for Test the generated proxy
  6. If you want to avoid confirmation messages when writing to existing files, select the check box for Overwrite files without warning
  7. If you want to avoid manual setup of file-system folders, select the check box for Create folders when necessary
  8. If you want to avoid confirmation messages when checking files out of a repository, select the check box for Check out files without warning
  9. Click Next

Service Deployment Configuration page

Do as follows at the Service Deployment Configuration page:

  1. Use the default values in this situation--

    If you are not using the defaults, click on the Edit button in the Server-Side Deployment Selection box. Select values for the run-time protocol and for the web application server.

  2. In the Service Web project field, specify the Web project where you want to store the Web service Java bean. Select a service project EAR.
  3. If you selected Generate a proxy on the Web services page, and you are not using the defaults, click on the Edit button in the Client-Side Environment Selection box. Select values for the run-time protocol and for the web application server. Select a client type, client project, and project EAR.
  4. Click Next.

Create an EGL Web Service page

Do as follows at the EGL Web Service page:

  1. Click the radio button that indicates one of two alternatives:
    1. You are creating a new EGL Web service without using a Web service definition file as the basis of your work; or
    2. You are using a Web service definition file, either to create a Web service from scratch or to update a bean and proxy. An update is necessary, for example, if you change the parameters of an EGL program used in the Web service.
  2. Specify the name of the package that will contain the EGL Web service Java bean. If you do not name the package, the Wizard uses the default package, with these results:
  3. Click Next.

EGL Web Service Definition page

Your tasks at the EGL Web Service Definition page vary as follows:

Web Service Mapping page

At the Web Service Mapping page, you map the previously selected EGL programs to Web service operations. For each entry in the list at the top of the page, do as follows:

  1. Click the program name.
  2. Either type an operation name into the Operation Name text box or accept the displayed value. You are required to specify an operation name explicitly if the program name is invalid as an operation name; for details, see Naming conventions.
  3. In the Operation Input Parameters area, select the check box for each EGL program parameter that you want to expose as an input parameter for the Web service operation.
  4. In the Operation Output Parameters area, select the check box for each EGL program parameter that you want to expose as an output parameter for the Web service operation.
  5. Click Next.

Web Service Java Bean Identity and Selection pages

Do as follows at the Web Service Java Bean Selection page:

  1. Enter the name of the Java bean to be used to create the Web service. Click the Browse classes button to view the bean class of the selected Java bean. Click Browse files to select a Java bean from the project.
  2. Check the box if you want to use an existing service endpoint interface (SEI), then enter the location of the service endpoint interface, browse the file system to locate it, or select from the classes included with WebSphere Studio.
  3. Click Next.

Do as follows at the Web Service Java Bean Identity page:

  1. In the Web Service URI text box, type the Uniform Resource Identifier (URI) that provides Internet access to your Web service.

    The default base http://tempuri.org/ comes from the WSDL specification of the World Wide Web consortium. You can use that base when testing the Web service in the WebSphere Test Environment. When you deploy the Web service, however, the URI should start with your organization's Web address or with another unique namespace.

  2. Select the check box for Use static methods; you do not need the Web service Java bean to be instantiated at run time.

    When you select Use static methods, the value in the Scope text box has no effect.

  3. If you wish to deploy the Web service with Secure Digital Signature security in the WebSphere Application Server, select the check box for Use secure SOAP. For details on security, see SOAP Security Extensions: Digital Signature (www.w3.org/TR/2001/NOTE-SOAP-dsig-20010206).

    The first Web service in a project determines whether a secure SOAP runtime is in use for any Web services in the project. Secure and non-secure Web services cannot coexist, but you can change the security status for the project in this way:

    1. Open the project file web.xml in the Web Deployment Descriptor editor or in an XML or text editor
    2. Remove the <servlet> elements for rpcrouter and messagerouter:

      <servlet>
        <servlet-name>rpcrouter</servlet-name>
         .
         .
         .
      </servlet>
       
      <servlet>
        <servlet-name>messagerouter</servlet-name>
         .
         .
         .
      </servlet>
      
    3. Re-run the EGL Web services wizard and choose a different setting for Use secure SOAP

    Also, if you are using the wizard to create a proxy, be aware that when you select or clear the check box for the security status of the Web service, the wizard assigns the same default value for the security status of the proxy. The two security statuses should be the same.

  4. In the Web Service URI text box, type (or accept the existing value for) the path of the ISD file, which is the service-specific deployment descriptor used by the SOAP run time. The path is relative to the workspace, and the default is appropriate in most cases.
  5. In each of the WSDL-related text boxes, type (or accept the existing value for) the path of the document or folder specified. The path is relative to the workspace, and the default is appropriate in most cases.
  6. If the defaults on subsequent pages in the wizard are appropriate (as is true in most cases), click Finish. If you wish to explore those pages, click Next as necessary, then click Finish.


Related concepts
EGL Web service


Application testing and publishingJava wrapper
Linkage options part
SOAP Security Extensions: Digital Signature
(www.w3.org/TR/2001/NOTE-SOAP-dsig-20010206)
Tools for Web services development
Web services overview


Related tasks
Adding a build descriptor part
Adding a linkage options part
Creating an EGL Web service definition file


Related reference
Java wrapper classes
linkage
Naming conventions


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]