Bonjour à tous ,

je suis entrain de travailler sur un projet open source qui utilise le web service avec Axis2,et je souhaite ajouter une classe que je pourrai appeler avec SOAP comme c'est le cas déjà dans ce projet.

Je ne connais pas la procédure à suivre pour ajouter ma classe et régénérer à nouveau le fichier wsdl ainsi que l'archive .aar


voici la partie concernant le web service dans le build.xml:

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 
<!-- Default Setting for compiling/generating/packaging the default GSN web services.  
Use the ant -D options to override these values in order to operate with your own webservice.
 eg: ant -Dwsroot=foo/bar -Dwsname=MyWebService dev-ws-generate-aar -->
 
     <!-- Default Web Service root path -->
     <property name="wsroot" value="${basedir}/webservices/standard"/>
     <!-- Default Web Service SOAP Address -->
     <property name="soapaddress" value="http://localhost:22001/services/standard/GSNWebService"/>
     <!-- Default source class used to generate the service (contract Last approach) -->
     <property name="sourceclass" value="gsn.webservice.standard.GSNWebService"/>
     <!-- Default WSDL used to generate the service (Contract First approach) -->
     <property name="sourcewsdl" value="${wsroot}/META-INF/GSNWebService.wsdl"/>
     <!-- Default name for the Axis deployable ARchive (.aar) -->
     <property name="wsname" value="GSNWebService"/>
 
     <!--  Generate the web service deployable axis archive (.aar).
     The archive contains the service description (wsdl), schema (xsd) and service file (xml) as well as the compiled    classes for the service.
     Move the .aar archive to the webapp/WEB-INF/services in order to enable the webservice.  -->
 
     <target name="dev-ws-package" depends="dev-ws-compile" description="Generate the web service deployable axis archive (.aar).">
         <!--
         <copy toDir="${wsroot}/build/META-INF" failonerror="false">
             <fileset dir="${wsroot}/resources/">
                 <include name="*.xml"/>
                 <include name="*.wsdl"/>
                 <include name="*.xsd"/>
             </fileset>
         </copy>
         -->
         <jar destfile="${wsroot}/${wsname}.aar">
             <fileset excludes="**/Test.class" dir="${wsroot}/build"/>
         </jar>
     </target>
 
     <!--
     The java source files are generated in the ${wsroot}/src directory.
     The ${sourcewsdl} sets the path to the WSDL file used to generate the classes.
     -->
     <target name="dev-ws-wsdl2java" depends="bind" description="Generates java code according to the given WSDL file to handle Web service invocation.">
         <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="false" dir="${basedir}" classpathref="classpath">
             <arg value="-o"/>
             <arg value="${wsroot}"/>
             <arg value="-s"/>
             <arg value="-ss"/>
             <arg value="-sd"/>
             <arg value="-R"/>
             <arg value="build/META-INF"/>
             <arg value="-uri"/>
             <arg value="${sourcewsdl}"/>
         </java>
     </target>
 
     <!--
     The WSDL is created in the ${wsroot}/META-INF directory, according to the ${sourceclass} class.
     The ${soapaddress} url defines the access point to the webservice.
     -->
     <target name="dev-ws-java2wsdl" depends="dev-ws-compile" description="Generates the appropriate WSDL file for the given java class.">
         <java classname="org.apache.ws.java2wsdl.Java2WSDL" fork="false" dir="${basedir}" classpathref="classpath">
             <arg value="-o"/>
             <arg value="${wsroot}/META-INF"/>
             <arg value="-cp"/>
             <arg value="${wsroot}/build/"/>
             <arg value="-l"/>
             <arg value="${soapaddress}"/>
             <arg value="-cn"/>
             <arg value="${sourceclass}"/>
         </java>
     </target>

Merci d'avance pour vos suggestions