You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Mike (JIRA)" <ji...@apache.org> on 2009/11/03 10:23:59 UTC

[jira] Created: (AXIS2-4542) nillable="true" gets generated for primitive types

nillable="true" gets generated for primitive types
--------------------------------------------------

                 Key: AXIS2-4542
                 URL: https://issues.apache.org/jira/browse/AXIS2-4542
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.5.1
            Reporter: Mike


An incorrect wsdl gets generated for primitive value wrapper objects. 
That is if you have a pojo with the following method:

public void testPrims(int prim, Integer nullable)
{
}

you get a wsdl with the following schema:

<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.test">
<xs:element name="testPrims">
    <xs:complexType>
        <xs:sequence>
            <xs:element minOccurs="0" name="prim" type="xs:int"/>
            <xs:element minOccurs="0" name="nullable" type="xs:int"/>
        </xs:sequence>
    </xs:complexType>
</xs:element>
</xs:schema>

the patch attached fixes the problem, please add the fix to the forecoming release

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


[jira] Commented: (AXIS2-4542) nillable="true" gets generated for primitive types

Posted by "Mike (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773417#action_12773417 ] 

Mike commented on AXIS2-4542:
-----------------------------

There is also a problem with minOccurs. I think an element should be generated with minOccurs="0" iff it has nullable="true" as according to wsdl (even with the patch applied) this request is legal:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<q0:testPrims/>
</soapenv:Body>
</soapenv:Envelope>

Unfortunately this request fails with an error as primitive int cannot be null.

In order to fix this problem, calls to setMinOccurs on lines 768 and 972 (the unpatched version) should be moved inside ifs on lines 769 and 973 respectively.

> nillable="true" gets generated for primitive types
> --------------------------------------------------
>
>                 Key: AXIS2-4542
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4542
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Mike
>            Assignee: Amila Chinthaka Suriarachchi
>         Attachments: patch.txt
>
>
> An incorrect wsdl gets generated for primitive value wrapper objects. 
> That is if you have a pojo with the following method:
> public void testPrims(int prim, Integer nullable)
> {
> }
> you get a wsdl with the following schema:
> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.test">
> <xs:element name="testPrims">
>     <xs:complexType>
>         <xs:sequence>
>             <xs:element minOccurs="0" name="prim" type="xs:int"/>
>             <xs:element minOccurs="0" name="nullable" type="xs:int"/>
>         </xs:sequence>
>     </xs:complexType>
> </xs:element>
> </xs:schema>
> the patch attached fixes the problem, please add the fix to the forecoming release

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


[jira] Assigned: (AXIS2-4542) nillable="true" gets generated for primitive types

Posted by "Keith Godwin Chapman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Keith Godwin Chapman reassigned AXIS2-4542:
-------------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> nillable="true" gets generated for primitive types
> --------------------------------------------------
>
>                 Key: AXIS2-4542
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4542
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Mike
>            Assignee: Amila Chinthaka Suriarachchi
>         Attachments: patch.txt
>
>
> An incorrect wsdl gets generated for primitive value wrapper objects. 
> That is if you have a pojo with the following method:
> public void testPrims(int prim, Integer nullable)
> {
> }
> you get a wsdl with the following schema:
> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.test">
> <xs:element name="testPrims">
>     <xs:complexType>
>         <xs:sequence>
>             <xs:element minOccurs="0" name="prim" type="xs:int"/>
>             <xs:element minOccurs="0" name="nullable" type="xs:int"/>
>         </xs:sequence>
>     </xs:complexType>
> </xs:element>
> </xs:schema>
> the patch attached fixes the problem, please add the fix to the forecoming release

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


[jira] Updated: (AXIS2-4542) nillable="true" gets generated for primitive types

Posted by "Mike (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4542?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike updated AXIS2-4542:
------------------------

    Attachment: patch.txt

> nillable="true" gets generated for primitive types
> --------------------------------------------------
>
>                 Key: AXIS2-4542
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4542
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.5.1
>            Reporter: Mike
>         Attachments: patch.txt
>
>
> An incorrect wsdl gets generated for primitive value wrapper objects. 
> That is if you have a pojo with the following method:
> public void testPrims(int prim, Integer nullable)
> {
> }
> you get a wsdl with the following schema:
> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.test">
> <xs:element name="testPrims">
>     <xs:complexType>
>         <xs:sequence>
>             <xs:element minOccurs="0" name="prim" type="xs:int"/>
>             <xs:element minOccurs="0" name="nullable" type="xs:int"/>
>         </xs:sequence>
>     </xs:complexType>
> </xs:element>
> </xs:schema>
> the patch attached fixes the problem, please add the fix to the forecoming release

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