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 Data tab should be visible in the Palette.

  3. In the Data tab, select

    Web Service, right-click and select

    Insert.

  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 references 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.

    4. The Web service you selected is now listed in the list of existing Web services. When you select it the only method available for this Web service is listed in the methods list. Click Finish to add it to your JSP.

  6. The proxy should now be shown in the Page Data view. If the Page Data view is not displayed you can open it by clicking

    Window | Show View | Page Data. Additionally, the method and the action to invoke it have been added to the JSP file.

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.