Creating a Web service proxy using Faces

The Web Service Discovery Dialog allows you to discover a Web service that exists online or in your workspace, create a proxy to the Web service, and then place the methods of the proxy on a Faces JSP file.

Prerequisite: You must have a Faces JSP file on which you will place the proxy methods.

To discover a Web service and create a proxy for it:

  1. Open your Faces JSP file in an editor by double-clicking it.

  2. The Page Data view should be open below the Project Navigator. If the Page Data view is not visible, open from the Window menu by selecting Show View > Other > Web > Page Data.

  3. In the Page Data view, right-click and select New > Web Service.

  4. In the Web Service Discovery Dialog, select how you want to find a Web service:

    Option Description
    Searching a public or private UDDI registry. If you select this option the UDDI Registry page displays.

    1. Enter the URL of a public or private UDDI registry, or select from the registries supplied.

    2. Enter the text with which you want to search the registry. This can include either the partial or full name or key (UUID) of the service.

    3. Select if you want to search by the name of the Web service, or by the key that is associated with a published Web service, and click Go.

    4. The UDDI Services table is populated with a list of available Web services that match your criteria, including their name, description, and a URL where their WSDL file is located.

      • To see additional information about the service, click Details. This will launch the Web service in the Web Services Explorer. For more information about using the Web Services Explorer, refer to Testing WSDL documents and Web services using the WSDL Explorer.

      • Click a WSDL file to continue creating your Web service proxy. Go to step 5.

    From a known URL. This can include known WSDL, WSIL, DISCO, and HTML URLs. When you select this option, the URL page displays. Enter the URL to a WSDL, WSIL, DISCO or HTML file that contains a Web service, and click Go.

    • If you entered a URL to a WSIL, HMTL, or DISCO file, a list of Web services available from the URL are displayed. Select one of the Web services by clicking on the WSDL file, and go to step 5.

    • If you entered a URL to a WSDL file, go to step 5.

    Selecting from Web services that are deployed and running in your workspace. If you selected to discover Web services that are in your workspace, the Workspace page displays. It contains a list of the Web services available in your workspace. Select a Web service by clicking on the appropriate WSDL file and go to step 5.
  5. Once you have selected a WSDL file, a table displays the Web Service name and location, any documentation included in the Web service, and lists the available ports.

    1. If there is more than one port, select the port for which you want to create the proxy.

    2. To test the Web service and to see additional information about it, click Details. This will launch the Web service in the Web Services Explorer. For more information about using the Web Services Explorer, refer to Testing WSDL documents and Web services using the WSDL Explorer.

    3. Once you have ensured that the chosen Web service is the correct one, click Add to Project. This generates your proxy bean.

  6. The proxy is now listed in the list of existing proxy beans. Click OK to add it to your Page Data.
  7. Select the proxy method in the Page Data view, and drag it onto your Faces JSP file Design view. You will be asked if you want to use this bean to update fields or to display fields. Select the appropriate choice, and if necessary add an action to the bean by clicking the Browse button beside the Action field. Repeat for any other elements that you want to add to the page.

The proxy for the Web service is now on a Faces JSP. Save the Faces JSP and run it on a sever to test your Web service.