blob: c06177c6d52cfbb56d8be5aaa5e458a52c4cfbd5 [file] [log] [blame]
Sample: POJO (Plain Old Java Object)
This is an example POJO Web service. It shows how to expose the methods of a Java class as a Web
service using Aixs2.
To build the sample service you must have ant-1.6.x installed in your system.
To set AXIS2_HOME in Unix/Linux type:
$export AXIS2_HOME=<path to axis2 distribution>
xerces.jar (Containing the intersection of the contents of xercesImpl.jar and xml-apis.jar)
You need to have this jar in your build and runtime class path. The easiest way to do this
is to copy it to Axis2_HOME/lib directory.
Building the Service
To build the sample service, type: $ant generate.service or just ant
This will build the AddressBookService.aar in the build directory and copy it to the
<AXIS2_HOME>/repository/services directory.
You can start the Axis2 server by running either axis2server.bat (on Windows) or
(on Linux)that are located in <AXIS2_HOME>/bin directory.
The WSDL for this service should be viewable at:
(e.g. http://localhost:8080/axis2/services/AddressBookService?wsdl)
src/sample/addressbook/rpcclient/ is a Client that uses RPCServiceClient
to invoke the methods of this web services just like the method invocations of a Java object.
Running the Client
To compile and run, type
$ant rpc.client
src/sample/addressbook/adbclient/AddressBookADBClient is Client that uses a generated stub with ADB
to invoke the methods of this web service.
To generate the stub, compile and run, type
$ant adb.client -Dwsdl=http://<yourhost>:<yourport>/axis2/services/AddressBookService?wsdl
Please contact axis-user list ( if you have any trouble running the sample.