I am trying to implement a simple example in axis2. I created the Service class and xml, generated aar and exploded in services directory. I can notice my service and operation sayHello, but when testing the webservice it says no such method sayHello in HelloAxisService which is my class.
Here is the services.xml
<service name="HelloAxisService">
<description>Hello Axis service</description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass">com.my.axis.HelloAxisService</parameter>
</service>
and here is my class
package com.my.axis;
public class HelloAxisService {
private String sayHello(String name){
return "Hello"+ name;
}
}
my url is http://localhost:8080/axis2/services/HelloAxisService/sayHello?name=dude
Though the service is present in list of services as below, I am getting the error both in the browser as well as Client program using axiom
Available services
HelloAxisService
Service EPR : http://localhost:8080/axis2/services/HelloAxisService
Service Description : No description available for this service
Service Status : Active
Available Operations
sayHello
After some careful observation at the code, found the problem. It was
privateaccess modifier for the method sayHello.Changing it topublicdid the thing for me.