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 runtime files (for example you can name it "calculator_deploy") and in it create a subdirectory called "server".
  3. Copy the application runtime files to the archive directory as follows:
    1. Copy all the files from $FGLDIR/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 runtime 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 runtime 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 the Genero Archive (gar) calculator_deploy.gar:

    gasadmin gar --deploy-archive calculator_deploy.gar
    A subdirectory is created in your $(res.deployment.path) directory identified by the configuration filename 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.