Hi Ranchers,
I am trying to use the
java annotations instead of xml files to deploy a web service some problems arise. I followed
this tutorial to create jax-ws web services.
The web service is a simple hello world :
It is compiled this way :
javac -cp /usr/local/tomcat/webapps/axis2/WEB-INF/lib/axis2-jaxws-api-1.4.1.jar ServiceTest.java
And deployed in a directory named "pojo" under the WEB-INF directory of the Axis2 web application inside
Tomcat :
cp ServiceTest.class /usr/local/tomcat/webapps/axis2/WEB-INF/pojo
In the "axis2.xml" configuration file :
<deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
So the pojo seems to be well deployed according to the Tomcat logs :
[INFO] Deploying pojo: ServiceTest - /usr/local/tomcat/webapps/axis2/WEB-INF/pojo/ServiceTest.class
The service and its method "hello" appear in the services list at "http://127.0.0.1:8080/axis2/services/listServices".
But when trying to access the wsdl description file of the service at "http://127.0.0.1:8080/axis2/services/ServiceTestService?wsdl" the result is :
However the wsdl2 is available at "http://127.0.0.1:8080/axis2/services/ServiceTestService?wsdl2".
Moreover when trying to invoke the service by using the url call "http://127.0.0.1:8080/axis2/services/ServiceTestService/hello" the result is :
<faultstring>Incoming message protocol does not match endpoint protocol.</faultstring>
The same service without annotations and deployed with a "services.xml" file as an "aar" archive in the "services" directory works fine.
So how to enable the use of annotated services by Axis2 ?
Thanks by advance for your help.