Within service element there is parameter element, which specifies the name of the java class as a
web service implementation. In the above example, parameter element with name attribute as “ServiceClass” is provided the name of the java class “examples.axis2.HelloWorldService” with
full path.
Within service element there is another element <operation>, which specifies the name of operation
i.e. the name of the method created in the web service implementation class. This element has child
element <messageReceiver> which specifies the message receiver that is to be used for that
operation. In the above example, we have set the name of the operation as “sayHello”.
Step 4: Create the Web Service Archive: (HelloWorldService.aar)
Next step for developing web service with Axis2 is to create “.aar” (Axis Archive) file. For our
example, we have created “HelloWorldService.aar”.
In the above steps we have created two files:
- HelloWorldService.java” file in “examples\axis2” folder and
- “services.xml” in “META-INF” folder.
Now create .aar file we can use jar tool in command prompt. Navigate to the path in the command
prompt where these above two folders have been saved and run the following command:
Jar cvf HelloWorldService.aar META-INF sample
This will create “HelloWorldService.aar” file in the current directory.
|