axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shameera Rathnayaka (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AXIS2-5159) Wsdl2Java doesn't handle properly multiple restrictions for a simpleType element
Date Fri, 07 Oct 2011 14:01:32 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-5159?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shameera Rathnayaka updated AXIS2-5159:
---------------------------------------

    Attachment: AXIS2-5159.patch

Hi Andrei Stefan and devs,

This is because even javaBeanWriter pass a pattern and xxxLenFacets values to the XSLTUtil
as attributes, in the ADBBeanTemplate it first check for pattern. If there is a pattern attribute
then it doesn't check for other attributes. By using pattern value it generates stub setter
method. i was able to fix this for the trunk(1.7.0) you can find patch with this.

Please review and commit to the trunk.

FYI :
issues https://issues.apache.org/jira/browse/AXIS2-4555 and https://issues.apache.org/jira/browse/AXIS2-3237
 already have fixed  
                
> Wsdl2Java doesn't handle properly multiple restrictions for a simpleType element
> --------------------------------------------------------------------------------
>
>                 Key: AXIS2-5159
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5159
>             Project: Axis2
>          Issue Type: Bug
>          Components: adb, codegen
>    Affects Versions: 1.4.1, 1.5.6, 1.6.1, 1.6.2, 1.7.0, nightly
>         Environment: Windows Vista, Eclipse 3.6.1
>            Reporter: Andrei Stefan
>         Attachments: AXIS2-5159.patch, bank.wsdl
>
>
> Considering the wsdl attached to this JIRA issue, for the following snippet:
> <element name="withdraw">
> 				<simpleType name="TNDataType">
> 					<xsd:restriction base="string">
> 						<xsd:minLength value="0" />
> 						<xsd:maxLength value="12" />
> 						<xsd:pattern value="[0-9]*" />
> 					</xsd:restriction>
> 				</simpleType>
> 			</element>
> this is the output generated in the BankServiceStub class:
> /**
>                                * Auto generated setter method
>                                * @param param TNDataType
>                                */
>                                public void setTNDataType(java.lang.String param){
>                             
>                                             if (org.apache.axis2.databinding.utils.ConverterUtil.convertToString(param).matches("[0-9]*"))
{
>                                                 this.localTNDataType=param;
>                                             }
>                                             else {
>                                                 throw new java.lang.RuntimeException();
>                                             }
>                                         
>                                }
> I've tested this further and the test cases don't, also, cover any combination of two
restrictions used together for the same element. If I take out the pattern then the two restrictions
for length are checked ok in the resulting code.
> There were previous reports related to the same issue (https://issues.apache.org/jira/browse/AXIS2-4555,
https://issues.apache.org/jira/browse/AXIS2-4205, https://issues.apache.org/jira/browse/AXIS2-3237)
but none seem to have fixed the issue reported above. Especially, https://issues.apache.org/jira/browse/AXIS2-4205,
which is identical but there seems to be no commit associated with it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


Mime
View raw message