axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Perez Jorge <>
Subject Re: How to publish two class with one WSDL?
Date Thu, 21 Oct 2004 15:05:26 GMT
Dacheng wrote:

>Can you do me a favor to give me an example?
Sure.  I have included ClassA and ClassB source code as examples. 
Command lines follows.

a) put .java files in src/ directory and compile source samples from 
src/ directory to build/ directory, incluing debug information:

javac -g -d build src/test/*.java

b) generate WSDL for ClassA:

java -cp $CLASSPATH:build org.apache.axis.wsdl.Java2WSDL -o 
serviceA.wsdl -l"http://localhost/axis/services/serviceA" test.ClassA

c) generate WSDL for ClassB merging ClassB's WSDL:

java -cp $CLASSPATH:build org.apache.axis.wsdl.Java2WSDL -o 
serviceB.wsdl --input=serviceA.wsdl 
-l"http://localhost/axis/services/serviceB" test.ClassB

I have included both wsdl files.  The one you would like to publish is 
serviceB.wsdl.  You can override the WSDL file that axis serves when 
using "?wsdl" url queries, so instead of generating the wsdl for each 
request you can tell axis to return serviceB.wsdl.  Check out this URL 
for that:

Hope that helped.

Adrian P.J.


View raw message