You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2010/01/15 18:15:33 UTC
Re: WSDL2JAVA, generating the java classes for elements with default values
You need to use our XJC "default value" plugin. Add:
-xjc-Xdv
to the wsdl2java command line.
Dan
On Fri January 15 2010 11:20:57 am piebetz@gmail.com wrote:
> Hi,
>
> is it possible with CXF 2.1.2 to generate the elements which are sended
> by/to the WSserver, with their default values declared as they are i nthe
> WSDL ?
>
> like I've the element :
>
> <xs:complexType name="Personinfo">
> <xs:sequence>
> <xs:element minOccurs="1" maxOccurs="1" name="param"
> type="xs:string" default="test">
> </xs:element>
> </xs:sequence>
> </xs:complexType>
>
> and I would like wsdl2java to generate something like :
>
> public class Personinfo{
>
> @XmlElement(name = "param")
> protected String param = "test";
>
> public String getParam() {
> return param ;
> }
>
> public void setParam(String value) {
> this.param = value;
> }
> }
>
>
>
> is there a way to do that ? the argument "-defaultvalues" do not do that .
>
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog