File tree Expand file tree Collapse file tree
webservices/axis2/helloworld Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import org .apache .ws .axis2 .*;
2+
3+ public class Client {
4+
5+ public static void main (String [] args ) throws Exception {
6+ // Create the stub object
7+ HelloServiceStub stub = new HelloServiceStub ();
8+
9+ // Create the request
10+ HelloServiceStub .Add request = new HelloServiceStub .Add ();
11+
12+ // Set the parameters
13+ request .setArgs0 (10 );
14+ request .setArgs1 (20 );
15+
16+ // Invoke the service
17+ HelloServiceStub .AddResponse response = stub .add (request );
18+ int ans = response .get_return (); // 10 + 20 = 30
19+ System .out .println ("Response : " + ans );
20+ }
21+
22+ }
Original file line number Diff line number Diff line change 1+ public class HelloService {
2+
3+ /**
4+ * This method will be the add operation of the web service.
5+ */
6+ public int add (int x , int y ) {
7+ int ans = x + y ;
8+ return ans ;
9+ }
10+
11+ }
Original file line number Diff line number Diff line change 1+ <service >
2+ <parameter locked =" false" name =" ServiceClass" >HelloService</parameter >
3+ <operation name =" add" >
4+ <messageReceiver class =" org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
5+ </operation >
6+ </service >
You can’t perform that action at this time.
0 commit comments