How can I control whether a service generates a doclit/wrapped or a doclit/bare WSDL?
At run time, we can view the WSDL by pointing a
browser to:
When we start with a Java class (using Axis2 1.3), there are two options
for the type of WSDL we can generate. The WSDL can be either doclit/wrapped
style or doclit/bare style. If we compare the 2 styles of WSDL, the structure
of the WSDL as well as the wire format of the Message is slightly different.
Also, the service cannot support both doclit/wrapped and doclit/bare at the
same time.
Then the question is how do we choose which style to generate. By default
Axis2 uses doclit/wrapped style. We can add the following parameter into the
services.xml to explicitly the generate the doclit/bare style:
<parameter name="doclitBare">true</parameter>
Also, when we want to generate doclit/bare WSDL, we have to keep in mind
that our Java class must conform to certain conditions:
- The method can have only one input parameter. If you have more than one
parameter, Axis2 will switch to doclit/wrapped. - Two methods should not have the same parameter name as shown below;
public class StockQuoteService {
public class MyService {
public int getValue(int index) {
return 10;
}
public String getName(String index) {
return null;
}
}
}
Applies To
Axis2/Java - 1.3