Hello there,
I am currently workin on a project involving web services in
java with Axis (v 1.2). What I want to do is to install a java class as a web service. At the moment I am stuck with the stub files generated (with wsdl2java), the reason is that after generating the stub files and modifying the webserviceSoapBindingImpl.java when I try to re-compile I get an error message. The problem is that there seem to be a conflict between the class Paquete that I create and the class ws.Paquete that is automatically created by wsdl2java.
I attach all the steps that I follow hoping that you guys can pinpoint what I am doing wrong.
Thanks a lot in advance for your help.
Cheers,
Dani
These are the versions I am working with:
-
Tomcat 5
- Axis 1.2 Beta
- Java 1.4.2
Let�s get started:
This is the class I want to deploy as a web service:
EmpresaLogisticaImpl.java
--------------------------------------------------------------------------------
Now I create an interface for the class I want to deploy as a web service:
EmpresaLogistica.java
--------------------------------------------------------------------------------
And now I add to the classpath all the classes that are not present:
set classpath=%classpath%;E:\Java\mis_Librerias\envio.jar;E:\Java\mis_Librerias\fechas.jar;E:\Java\mis_Librerias\oferta.jar;E:\Java\mis_Librerias\envio.jar;E:\Java\mis_Librerias\seguridad.jar;E:\Java\mis_Librerias\paquete.jar
--------------------------------------------------------------------------------
Next, I create the WSDL file:
java org.apache.axis.wsdl.Java2WSDL -o empLog.wsdl -l"http://localhost:8080/axis/services/EmpresaLogistica" -n urn:recepcionPaquetes -p"recepcionPaquetes" urn:recepcionPaquetes recepcionPaquetes.EmpresaLogistica
--------------------------------------------------------------------------------
And from the WSDL file I create the stubs:
java org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -p recepcionPaquetes.ws empLog.wsdl
which generates the following files:
deploy.wsdd
EmpresaLogistica.java
EmpresaLogisticaService.java
EmpresaLogisticaServiceLocator.java
EmpresaLogisticaSoapBindingImpl.java
EmpresaLogisticaSoapBindingStub.java
Oferta.java
Paquete.java
undeploy.wsdd
I now open EmpresaLogisticaSoapBindingImpl.java to crete the modifications needed:
--------------------------------------------------------------------------------
But when I compile the classes I get the following error message:
E:\Java\eclipse\workspace\D_empresa_logistica\recepcionPaquetes>javac ws\*.java
ws\EmpresaLogisticaSoapBindingImpl.java:34: getOferta(java.lang.String,java.lang.String,paquete.Paqu
ete) in recepcionPaquetes.EmpresaLogisticaImpl cannot be applied to (java.lang.String,java.lang.Stri
ng,recepcionPaquetes.ws.Paquete)
return empresa.getOferta(in0,in1,in2);
^
1 error
--------------------------------------------------------------------------------
Let me also include the classes Paquete.java :
And also Oferta.java:
--------------------------------------------------------------------------------
Personally I think that there is a conflict between the class Paquete.java and the class ws.Paquete.java that is generated. This does not happen with the class Oferta.java, and the situation is the same!
If I could compile all this I would only have to wrap up the different classess in a .jar file and copy them to the tomcat directory to do the deploy with java org.apache.axis.client.AdminClient deploy.wsdd
--------------------------------------------------------------------------------
I think this is all. I would really appreciate if you could have a look at what I do and tell me the steps that I do wrong, I would also like to know why the two extra classes, ws.Paquete.java and ws.Oferta.java are created.
Thank you very much.
Regards,
dani
[ January 06, 2005: Message edited by: Daniel S.G. ]