Deploy a Web service

When you have your Web service application configured correctly and running on the GWS, you are now ready to package the files required to deploy it as a Web service on the Genero Application Server.

For the purposes of this quick start, you can use the configuration files created for the Calculator Web service. See Configure a Web service.

  1. Update the Web service configuration file, for example, Calculator.xcf <PATH> element as follows:
    <PATH>$(res.deployment.path)/server</PATH>
  2. Create a new directory where you will archive the Web service source files (for example you can name it "calculator_deploy") and in it create a sub-directory called "server".
  3. Copy the application source files to the archive directory as follows:
    1. Copy all the files from $FGLASDIR/demo/WebServices/calculator/server to the server subdirectory in your archive directory
    2. Copy the updated Web service configuration file, Calculator.xcf, to the server subdirectory.
  4. Create a MANIFEST file and save it with the name "MANIFEST" (without extension) to the directory that contains the application source files. For more information see MANIFEST file.
    <MANIFEST>
      <DESCRIPTION>This archive contains one service</DESCRIPTION>
      <SERVICE xcf="Calculator.xcf" />
    </MANIFEST>
  5. Create a Genero Archive (gar) file to deploy your application with the following steps:
    1. From the command line, navigate to the archive directory that contains the application source files AND the MANIFEST file.
    2. Enter the command: fglgar --gar.
      A Genero archive (gar) file is created in your current directory that has the same name as the directory.

Test the deployment on your standalone dispatcher.

  1. To deploy your (gar) file locally on your GAS, unpack its files in your $(res.deployment.path) deployment directory.

    To deploy a Genero Archive (gar) file named calculator_deploy.gar:

    gasadmin gar --deploy-archive calculator_deploy.gar
    A subdirectory is created in your $(res.deployment.path) directory identified by the configuration file name and the date and time deployed, e.g. calculator_deploy-20150423-130838. All the files contained in the Genero Archive (gar) file are placed in the directory.
  2. To enable your deployed Web service locally on your GAS, perform the following steps:

    To list all deployed archives:

    gasadmin gar --list-archives

    To enable the archive, reference it by its archive name:

    gasadmin gar --enable-archive calculator_deploy
    This enables the Web server by copying the configuration file to the $(res.path.services) directory.

To test the deployed Web service, start the Calculator server and run a client application that uses the service by performing the following steps:

  1. Start the standalone dispatcher from the command line, for details about starting httpdispatch see Dispatcher: httpdispatch.
  2. To start the Calculator web service, in a browser tab enter the address of the web service application:

    http://localhost:6394/ws/r/Calculator

  3. To interact with the Calculator service and show it is working, open another browser tab and enter the address of the demo applications:

    http://localhost:6394/ua/r/gwc-demo

  4. In the Topic tree, navigate to WebServices >> Calculator >> Client. Double-click on the demo Calculator Soap 1.2.
    The Web Services URL dialog appears.
  5. From the drop down menu select one of the following options:
    • http://localhost:6394/ws/r/demo/Calculator

    • Or select the option (Customize) Click here to add your own URL and provide the URL to your configured web service.
    Click OK when finished

    You should see a calculator screen and be able to interact with it. You have successfully deployed a Web service.

The steps to configure and deploy a web service on your own machine shown here, can be adapted for deployment on GAS installation on other hosts.