[ 
https://issues.apache.org/jira/browse/AXIS2-3511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12577078#action_12577078
 ] 

Haneef Ali commented on AXIS2-3511:
-----------------------------------

Hi 
I'm using  axis 2 1.3. I'm using ADB for code geneation.

Consider the following schema

<xsd:complexType name="LineItemWSType">
                                <xsd:sequence>
                                        <xsd:element name="lineNumber" 
type="xsd:int"/>
                                        <xsd:element name="vendor" 
type="tns:VendorWSType" minOccurs="0"/>
                                        <xsd:element name="productCategoryWS" 
type="tns:ProductCategoryWSType"/>
                                        <xsd:element name="quantity" 
type="xsd:int"/>
                                        <xsd:element name="discountAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:element name="discountCode" 
type="xsd:string" minOccurs="0"/>
                                        <xsd:element 
name="totalPriceWithoutTax" type="xsd:decimal" default="0"/>
                                        <xsd:element name="cityTaxAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:element name="districtTaxAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:element name="countyTaxAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:element name="stateTaxAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:element name="nationalTaxAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:element name="totalTax" 
type="xsd:decimal" default="0"/>                           
                                        <xsd:element name="grossAmount" 
type="xsd:decimal" default="0"/>
                                        <xsd:any namespace="##any" 
minOccurs="0"/>
                                </xsd:sequence>
                        </xsd:complexType>

ADB is going to generate the class LineItemWSType. Consider the following java 
code fragment

   LineItemWSType ls = new LineItemWSType();
    ls.setLineNumber("1");
    ls.setProductCategory(new ProductCategoryWSType());

   // I believe I don't need to set  other fields which have default value 
defined in the schema. All those fields are mandatory fields. So during 
serialization, ADB should generate the xml with all those fields with default 
values. This is not happening.   Instead I'm getting an error saying mandatory 
field  "discountAmount" is not set etc


Haneef
  


> Axis doesn't send default values
> --------------------------------
>
>                 Key: AXIS2-3511
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3511
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Haneef Ali
>
> <xsd:complexType name="MyType">
> <xsd:element name="myName" default="SomeName" />
> </xsd:complexType>
> If the client doesn't set the value of the field myName, then Axis needs to 
> set it to default value, since it is a required field. Axis doesn't do that
> Haneef

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to