Creating an axis2/java aar file – HP Integrity NonStop J-Series User Manual

Page 338

Advertising
background image

The service skeleton file for your web service is created and you need to implement the required
business logic.

Update the service skeleton file with the business logic

To update the business logic in the service skeleton file, complete the following steps:

1.

Modify the <My SASH
Home
>\axis2\gettingstarted\TemperatureConverter-Contract-First\src\org\apache\ws\axis2\

TemperatureConverterSkeleton.java

file to implement the c2F conversion and f2CC

conversion (to convert Celsius to Fahrenheit and Fahrenheit to Celsius respectively) methods
using any text editor.

2.

Verify that the skeleton file resembles the following code snippet:

* by the Apache Axis2 version: 1.5.2 Built on : Sep 06, 2010 (09:42:01 CEST)
*/
package org.apache.ws.axis2;

/**
* TemperatureConverterSkeleton java skeleton for the axisService
*/
public class TemperatureConverterSkeleton {

/**
* Auto generated method signature
*
* @param c2FConversion
*/

public org.apache.ws.axis2.C2FConversionResponse c2FConversion(
org.apache.ws.axis2.C2FConversion c2FConversion) {
double fValue = c2FConversion.getArgs0();
org.apache.ws.axis2.C2FConversionResponse response = new C2FConversionResponse();
response.set_return(((fValue - 32.0) * 5.0) / 9.0);

return response;
}

/**
* Auto generated method signature
*
* @param f2CConversion
*/

public org.apache.ws.axis2.F2CConversionResponse f2CConversion(
org.apache.ws.axis2.F2CConversion f2CConversion) {
double fValue = f2CConversion.getArgs0();
org.apache.ws.axis2.F2CConversionResponse response = new F2CConversionResponse();
response.set_return(((fValue - 32.0) * 5.0) / 9.0);
return response;
}

Creating an Axis2/Java AAR File

An Axis2/Java AAR file contains the compiled code of the service implementation class, and the
services.xml

file. To create an Axis2/Java AAR file, complete the following steps:

1.

Go to the <My SASH
Home
>\Axis2\gettingstarted\TemperatureConverter-Contract-First

directory

using the command:

command prompt> cd <My SASH Home>\Axis2\gettingstarted\TemperatureConverter-Contract-First

2.

Create the AAR archive using the command:

command prompt> ant

The TemperatureConverter.aar file is created in the <My SASH
Home
>\Axis2\gettingstarted\TemperatureConverter-Contract-First\build\lib
directory.

338 Getting Started with Axis2/Java

Advertising
This manual is related to the following products: