bonjour, nous sommes sur un projet dans lequel nous devosn creer un webservice en passant par un fichier WSDL.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 package pkgDsd.pkgInterface; import pkgDsd.pkgInterface.pkgFunction.*; public class classInterfaceSWI { public static classCreateWR CreateWR; /** Creates a new instance of classInterfaceSWI */ public classInterfaceSWI() { } public static String createWR(){ String code_WR; CreateWR = new pkgDsd.pkgInterface.pkgFunction.classCreateWR(); try{ code_WR = CreateWR.createWR(); return code_WR; }//si la DI est créée alors on lui renvoi le code, sinon on lui renvoi NULL catch(Exception e){ return null; } } }
Pour se faire nous utilisons axis et Tomcat 5.5.
le fichier se compile parfaitement cependant lors du java2wsdl, nous rencontrons l'erreur suivante:
Exception in thread "main" Java.Lang.NoClassDefFoundError: org/axis/apache/wsdl/java2wsdl
voici notre fichier java2wsdl.bat qui permet l'operation
pouvez vous nous aider a resoudre ce probleme.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 REM on fixe JAVA_HOME et PATH REM on fixe le classpath: set AXIS_HOME=C:\"%Program Files%"\"%Apache Software Foundation%"\"%Tomcat 5.5%"\webapps\axis\WEB-INF set AXIS_LIB=%AXIS_HOME%\lib set AXIS_CLASSPATH=%AXIS_LIB%\axis.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\axis-ant.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\commons-discovery-0.2.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\commons-logging-1.0.4.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\jaxrpc.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\log4j-1.2.8.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\saaj.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\wsdl4j-1.5.1.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\xercesImpl.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\xercesSamples.jar REM ajuster les chemins vers activation.jar et mail.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\mail.jar set AXIS_CLASSPATH=%AXIS_CLASSPATH%;%AXIS_LIB%\activation.jar pause REM on compile la classe. pas besoin de classpath particulier pour compiler md bin javac -d bin -sourcepath src "C:\Program Files\j2sdk1.4.2_04\bin\classInterfaceSWI.java" pause REM on appele axis java2wsdl java org.apache.axis.wsdl.Java2WSDL -o ../swi.wsdl -l "http://localhost:8080/axis/services/swi" pkgDsd.pkgInterface.classInterfaceSWI pause
merci
Giyome et Tigrou
Partager