Generating JavaScript for a Web Service Exposure

From the Web Service Consumer Browser, the Generating JavaScript command from the Consumer menu enables you to generate JavaScript for a Web service exposure.

To generate JavaScript for a Web service exposure

  1. In the Exposure Browser, select the Web service exposure from which to generate JavaScript.

  2. Select the Generate JavaScript command from the Exposure menu. The Web Service JavaScript Generation dialog, shown in the following example, is then displayed.

  3. If you want the JavaScript files created in a directory other than the program directory, enter the location in the Output Directory text box. Alternatively, click the Browse button and the common file Open dialog is then displayed to enable you to select the appropriate location.

  4. Enter a namespace in the Module Namespace text box. The namespace refers to the root JavaScript variable name that the generated scripts use. For example, if the namespace is Jade, the instruction to call a Web service from JavaScript would be in the following format.

    Jade.<provider>.<method>(<parameters>);
  5. Select a Web service provider application that uses the exposure in the Web service application combo box. This enables the generated JavaScripts to access the correct application. (See also Chapter 4, "Using the Rich Internet Application (RIA) Framework", in the JADE Web Application Guide.)

  6. Click the Generate button. Alternatively, click the Cancel button to abandon your selections.

A number of JavaScript (.js) files are created in the specified directory.