Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Follow the instructions below to deploy a Jar service in a running WSO2 AS instance.

  1. Log on to the product's Management Consolemanagement console and select Main -> Services -> Add -> Jar Service.
  2. The "Add Jar Service" page appearsopens. The "Artifact" and "Service Group Name" fields are mandatory. Others are optional.
    Image Modified
    Service Hierarchy

    Specifying a service hierarchy is optional. It allows you to customize your service endpoint reference. If the business logic of the same service changes over time, you can maintain multiple versions of the service by using service hierarchy at the deployment. 

    For example, consider a service named "Version"

    If the service hierarchy is not mentioned, then the service endpoint reference is ../services/Version. With service hierarchy specified, for example as 1.0.0, the endpoint reference is ../services/1.0.0/VersionSpecifying a hierarchy is important if you want to manage services separately.
  3.  Specify the service archive details and click Next.
    Image Modified

    Info

    You can add more files by clicking the "Add more dependencies" link. The "-" sign removes the option to add more files.

    If Step 1 is  

  4. If the above steps are successful, you will be shown all the classes in the .jar file/files that you uploaded in Step 1

    Info

    You can specify the following properties in the selected classes:

    • Service Name: Name of the Web service created from the selected class.
    • Deployment Scope: There are four ways in which you can deploy a service. The scope of the service relates to the life cycle of the service instance. They are defined as follows.:
      • Application - Service instance lifetime is equal to the server lifetime. Service class will be initialized only once for a running server. This is useful in developing stateful Web services.
      • Request - Service class is initialized for each and every request.
      • SOAP Session - Axis2 supports a SOAP session using a SOAP specific cookie. Here, the service instance lifetime is equal to the lifetime of the SOAP session.
      • Transport Session - Service instance lifetime is equal to the lifetime of the transport session.
    • Use Original WSDL: Determines whether or not to use the original WSDL in the service archive or not. This property can only be specified if you have already uploaded a WSDL in Step 1the above steps. If this is set to 'False', then the WSDL will be generated since it is not specified in step 1earlier.
  5. Step 2: Select one or more classes to be exposed as Web services and click click Next.
  6. Step3: You will be shown the set of classes selected in Step 2 along with the operations in each of those classes. All methods are selected by default. Deselect the ones you do not wish to expose as Web Service service operations and click click Finish.
  7. If the file is uploaded successfully, a message appears prompting you to refresh the page. Click OK.
  8. Refresh the "Deployed Services" page in the product's Management Console management console to view the newly added service listed.