I have created a pojo as below.
package demo;
public class HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
I placed it in axis2 war and opened
http://localhost:8080/axis2/services/listServices.
Axis 2 is indicating it as faulty service
Faulty Services
<TOMCAT-DIR>\webapps\axis2\WEB-INF\pojo\demo\HelloWorld.class
But when I remove package declaration statement and place it on below location, everything works fine
<TOMCAT-DIR>\webapps\axis2\WEB-INF\pojo\HelloWorld.class
Now there are two possibilities
Can anyone guide me?
In the book "Apache Axis Web Services, 2nd Edition", author described that when exposing a pojo class as a web service by dropping in into pojo folder, pojo class must be defined in default package.
When pojo class is defined some package, following link is helpful.
http://axis.apache.org/axis2/java/core/docs/pojoguide.html
Thanks to shashankaholic for sharing this link.