• Error: A WebService annotation is not present on class: com.

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #4581  by janetao2000
 
Hi, guys:
I installed openKm in one pc 'A', and in another pc 'B', I generate a webservice client jar file, run a java application to call 'A''s webservice. Initially, the client can't access to openKm webservice, throwing connection timeout error. After I can add 'A's external IP and domain name to the file 'hosts', it works well.

Yet if I call openKm webservice from a web application (deployed to jetty, use mvn run it) instead of java application, then
Code: Select all
OKMAuthService okmAuthService = new OKMAuthService();
OKMAuth okmAuth = okmAuthService.getOKMAuthPort();
calling okmAuthService.getOKMAuthPort() will throw RuntimeModelerException: "A WebService annotation is not present on class: com.openkm.ws.client.OKMAuth".

Someone knows what cause it and how to solve it?

Regards,

Jane
 #4582  by jllort
 
I don't know what are you doing but seems something strange.

Normally you might use like :
Code: Select all
OKMAuthService okmAuthService = new OKMAuthService();
String token =  okmAuthService.login("user","pass");
If you've generated classes with wsdl, you might change some localhost:8080/OpenKM fixed in class for some external and configurable variable (remote accessing ).
 #4589  by pavila
 
If you call a SOAP method located in another host different from where you generated the java stuf from WSDL, try:
Code: Select all
OKMAuthService okmAuthService = new OKMAuthService();
OKMAuth okmAuth = okmAuthService.getOKMAuthPort();
BindingProvider bp = (BindingProvider)okmAuth; 
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url+"/OKMAuth");
 #4601  by janetao2000
 
Thanks all for your reply. After several tests, I think that the error is caused by classpath settings. Right now we use jetty to run our web application, which will call remote openKm web service. Yet when running the line OKMAuth okmAuth = okmAuthService.getOKMAuthPort();
It fails. I deployed the same application war to tomcat, then no problem.
So my current questions is how to get classpath running under jetty and compare it with one under tomcat. (We need use jetty).
 #4614  by janetao2000
 
I am using java under windows xp. To generate ws client stubs, using the following cmds:
wsimport -s . -p com.openkm.ws.client http://localhost:8080/OpenKM/OKMAuth?wsdl
wsimport -s . -p com.openkm.ws.client http://localhost:8080/OpenKM/OKMDocument?wsdl
wsimport -s . -p com.openkm.ws.client http://localhost:8080/OpenKM/OKMFolder?wsdl
wsimport -s . -p com.openkm.ws.client http://localhost:8080/OpenKM/OKMSearch?wsdl
wsimport -s . -p com.openkm.ws.client http://localhost:8080/OpenKM/OKMNotification?wsdl
wsimport -s . -p com.openkm.ws.client http://localhost:8080/OpenKM/OKMRepository?wsdl

Then, you can get the generated source codes and compiled classes.
BTW, wsimport is only available under jdk 1.6+.
 #4655  by jllort
 
Yes it could be some problem on it. The same webservices declaration present in OpenkM 4.0 - jboss 4.0 has problems with jboss 5.0, really jboss webservices sometimes could be tedious.

If it's derived from some classes problem you could try to isolate application ( I don't know if it could solve something ).

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.