Post a Job  |   Ask a Question?   |   Already registered? login or register
Munendra Kumar
17/02/2016 01:11 PM

Deploy POJO class as WebService In Axis2


Hello friends, if you wanted to deploy your pojo class then you have to follow certain rules and well in these way you never need to run Java2wsdl tool :- Hello friends, if you wanted to deploy your pojo class then you have to follow certain rules and well in these way you never need to run Java2wsdl tool :- 1) Select a simple java project 2) write your Input and Output classes if you want or you can simply work with primitive types 3) write your interface(but it is optional), here i am using Interface 4) write your Implementation class and override all the methods that you wanted to expose as WebService 5) create a folder called lib and put all the Axis2 jars inside it. 6) The main part is you have to write services.xml and this is so easy -
[Note :- copy and paste this xml and do ctrl+shift+f then it will format automatically] [Note: Don't change anything inside the tag like <parameter name="ServiceClass"> if you are going to change your service will become not accessible] 7) Now save this file as must and should be services.xml only 8) now export your project as anything.jar and rename it anything.aar 9) finally deploy this into services directory. 10) goto http://localhost:8855/axis2/services/listServices I think every one is able to access service successfully if any one face any problem then ask me
Spam    5 Comments

Hemant,Yadav
17/02/2016 17:10:21
After giving qualified class name as part of <parameter/> the error comes as:- -------------------------------------------------------------------------------- [ERROR] The PojofiedService.aar service, which is not valid, caused The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.a ar org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.aar at org.apache.axis2.......... ............ ............... ................ Caused by: org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.aar at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:147) ... 12 more [INFO] org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.aar ,After giving qualified name of Class the error come as:- --------------------------------------------------------------------- [ERROR] The PojofiedService.aar service, which is not valid, caused The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.a ar org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.aar at org.apache.axis2.......... .................... .................... Caused by: org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.aar at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:147) ... 12 more [INFO] org.apache.axis2.deployment.DeploymentException: The services.xml file cannot be found for the service: D:\Tomcat 6.0\webapps\axis2\WEB-INF\services\PojofiedService.aar

Munendra,Kumar
17/02/2016 17:45:08
Name of the xml must and should be services.xml and place it inside src\META-INF\services.xml i think you missed 's' thats why its telling services.xml cannot be found

Chenna,JDevp
17/02/2016 22:48:17
another way to work pojo application.. write simple primitive type java class with in default package,copy the .class and go to the "Tomcat\webapps\axis2\WEB-INF" in the WEB-INF create one folder named as "pojo", dropped .class into this directory run the tomcat server it will be deployed, Thanku any quires drop a comment

SivaNaganjaneyulu,Chunduri
19/02/2016 11:47:27
how to provide implementation class in web-inf folder pls help me chenna

SivaNaganjaneyulu,Chunduri
19/02/2016 12:11:07
how to provide implementation class in web-inf folder pls help me chenna

Languages :
xml