axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2-5663) wsdl2java creates invalid java code with extension + choice
Date Thu, 31 Jul 2014 22:48:39 GMT

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

Martin Gainty commented on AXIS2-5663:
--------------------------------------

IF the test is choice  and as long as we have properties then the value is set

   <xsl:if test="$choice">
            /** Whenever a new property is set ensure all others are unset
             *  There can be only one choice and the last one wins
             */
            private void clearAllSettingTrackers() {
            <xsl:for-each select="property">
                <xsl:if test="not(@attribute)">
                   local<xsl:value-of select="@javaname"/>Tracker = false;
                </xsl:if>
           </xsl:for-each>
            }
        </xsl:if>

this is a genuine bug here is the code:
org.apache.axis2.schema.template.ADBBeanTemplate.xsl:
remember that the previous criteria was 
IF the test is choice  and as long as we have properties then the value is set

                 <xsl:if test="not(enumFacet)"> //?
//? this SHOULD be in  <xsl:if test="not(enumFacet)"  or  (test="$choice")>)
                        <!-- Generate a tracker only if the min occurs is zero, which means
if the user does
                           not bother to set that value, we do not send it  -->
                           <xsl:if test="$min=0 or $choice">
                           /*  This tracker boolean wil be used to detect whether the user
called the set method
                          *   for this attribute. It will be used to determine whether to
include this field
                           *   in the serialized XML
                           */
              protected boolean <xsl:value-of select="$settingTracker"/> = false ; //IF
$min==null AND $choice is null dont generate
                           </xsl:if>
                 </xsl:if>

So the problem seems to be org.apache.axis2.schema.template.ADBBeanTemplate.xsl:

Good Catch!

> wsdl2java creates invalid java code with extension + choice
> -----------------------------------------------------------
>
>                 Key: AXIS2-5663
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5663
>             Project: Axis2
>          Issue Type: Bug
>          Components: wsdl
>    Affects Versions: 1.6.2
>         Environment: Windows 7 SP1 64bit
> axis2 1.6.2
>            Reporter: Daniel Johnson
>              Labels: wsdl2java
>         Attachments: example.wsdl, trimmed.xsd
>
>
> When trying to generate java source for a vendor provided WSDL file (with XSD), I got
java source that would not compile because it referenced fields which did not exist.
> I ran:
> {noformat}
> wsdl2java -uri example.wsdl -u
> ant
> {noformat}
> The compilation error is:
> {noformat}
>     [javac] c:\Users\djohnson\Documents\Intrado\WSDL\trimmed\src\com\example\namespaces\def\UpdateResponseType.java:31:
error: cannot find symbol
>     [javac]                    localInteger1Tracker = false;
>     [javac]                    ^
>     [javac]   symbol:   variable localInteger1Tracker
>     [javac]   location: class UpdateResponseType
> {noformat}
> (+5 more of these)
> I spent this afternoon creating this reduced testcase which is attached. The above errors
are from the reduced testcase, although they are essentially identical to the ones I got with
the real WSDL.
> My uneducated guess is that the generator is treating the base type's sequence members
as choices of the subtype. But I have only a basic understanding of WSDL or XML Schemas, so
I am out of my element here.
> Please let me know if there is any more information that would be useful, I'd be happy
to provide it.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
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