axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Massimiliano Ziccardi <massimiliano.zicca...@gmail.com>
Subject AXIS2 and optional parameter
Date Fri, 01 Oct 2010 09:31:21 GMT
Hi All.

I have the following WSDL (just an extract):

<element name="op">
  <complexType>
  <sequence>
    <element name="cert" type="xsd:string"/>
    <element name="reason" type="xsd:int"/>
    <element name="comment" type="xsd:string"/>
    <element name="opDate" type="xsd:dateTime"/>
    </sequence>
  </complexType>
</element>

opDate is optional : the user must be able to pass 'null'.

I have no problems with axis1, while I can't pass null with AXIS2 because I
always get 'opDate cannot be null'.

Looking through the code, I found this inside the generated stub:

if (localOpDate==null)
{
// write the nil attribute
   throw new org.apache.axis2.databinding.ADBException("opDate cannot be
null!!");
}
else
{
xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localOpDate));
}

Is there any way I can tell WSDL2JAVA that some parameter is optional?
If I have to change the wsdl, since it is autogenerated by AXIS2 server
side, is there a way I can tell AXIS to generate the parameter as optional
inside the WSDL?

Thanks a lot,
Massimiliano

Mime
View raw message