[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-dev
Subject:    Fwd: WSDL optional attributes
From:       Luis Rivera <luiggiilca () gmail ! com>
Date:       2010-01-28 19:58:22
Message-ID: c8d1d53b1001281158h60177e88m6418238761593951 () mail ! gmail ! com
[Download RAW message or body]

Hi,

This is my send try. I guess I will need to open JIRA bug for this, since
nobody seems to know what this happens!

I have a problem with the wsdl2java code generation in axis2 for optional
attributes

In short, how can I make it generate Objects instead of primitives for
OPTIONAL ATTRIBUTES?

Axis1 would generate them as Objects, which was great since I could look for
nulls as a sign that the client had not include them in the message.

However, with Axis2, the class end up with primitives, instead of objects
(e.g. int instead of Integer).

. Take the following extract from my WSDL schema:

...
<xsd:attributeGroup name="ccAttributes">
     <xsd:attribute name="ccCGMS_A" type="xsd:int" use="optional"/>
     <xsd:attribute name="ccACP" type="xsd:int" use="optional"/>
     <xsd:attribute name="ccDwightCavendish" type="xsd:boolean"
use="optional"/>
     <xsd:attribute name="ccHDCP" type="xsd:boolean" use="optional"/>
 </xsd:attributeGroup>
<xsd:attributeGroup name="osdAttributes">
     <xsd:attribute name="osdActive" type="xsd:boolean" use="optional"/>
     <xsd:attribute name="osdDuration" type="xsd:int" use="optional"/>
     <xsd:attribute name="osdType" type="xsd:int" use="optional"/>
     <xsd:attribute name="osdLocation" type="xsd:int" use="optional"/>
 </xsd:attributeGroup>
<xsd:complexType name="streamAttributes">
                <xsd:attribute name="channelNumber" type="xsd:int"
use="required"/>
                <xsd:attribute name="sourcePort" type="xsd:int"
use="required"/>
                <xsd:attribute name="sourceAddress" type="xsd:string"
use="required"/>
                <xsd:attribute name="targetPort" type="xsd:int"
use="required"/>
                <xsd:attribute name="targetAddress" type="xsd:string"
use="required"/>
                <xsd:attribute name="level" type="xsd:byte" use="required"/>
                <xsd:attribute name="mutationInterval" type="xsd:long"
use="required"/>
                <xsd:attribute name="insertionInterval" type="xsd:long"
use="required"/>
                <xsd:attribute name="type" type="xsd:byte" use="required"/>
                <xsd:attribute name="description" type="xsd:string"
use="required"/>
                <xsd:attribute name="ID" type="xsd:string" use="required"/>
                <xsd:attributeGroup ref="ns:ccAttributes" />
                <xsd:attributeGroup ref="ns:osdAttributes" />
            </xsd:complexType>
...

So, how could I coerce the axis2 generator to behave like axis1 in this
particular issue?

Thanks in advance,
--Luis R.

[Attachment #3 (text/html)]

<div class="gmail_quote"><div \
class="gmail_quote"><br><div>Hi,</div><div><br></div><div>This is my send try. I \
guess I will need to open JIRA bug for this, since nobody seems to know what this \
happens!</div><div><div></div> <div class="h5">
<div><br></div><div>I have a problem with the wsdl2java code generation in axis2 for \
optional attributes</div><div><br></div><div>In short, how can I make it generate \
Objects instead of primitives for OPTIONAL ATTRIBUTES?</div>


<div><br></div><div>Axis1 would generate them as Objects, which was great since I \
could look for nulls as a sign that the client had not include them in the \
message.</div><div><br></div><div>However, with Axis2, the class end up with \
primitives, instead of objects (e.g. int instead of Integer).</div>


<div><br></div><div>. Take the following extract from my WSDL \
schema:</div><div><br></div><div>...</div><div><div><span \
style="white-space:pre">	</span>&lt;xsd:attributeGroup \
name=&quot;ccAttributes&quot;&gt;</div> <div><span style="white-space:pre">	</span>   \
&lt;xsd:attribute name=&quot;ccCGMS_A&quot; type=&quot;xsd:int&quot; \
use=&quot;optional&quot;/&gt;</div><div><span style="white-space:pre">	</span>     \
&lt;xsd:attribute name=&quot;ccACP&quot; type=&quot;xsd:int&quot; \
use=&quot;optional&quot;/&gt;</div>


<div><span style="white-space:pre">	</span>     &lt;xsd:attribute \
name=&quot;ccDwightCavendish&quot; type=&quot;xsd:boolean&quot; \
use=&quot;optional&quot;/&gt;</div><div><span style="white-space:pre">	</span>     \
&lt;xsd:attribute name=&quot;ccHDCP&quot; type=&quot;xsd:boolean&quot; \
use=&quot;optional&quot;/&gt;</div>


<div><span style="white-space:pre">	</span>&lt;/xsd:attributeGroup&gt;</div><div><span \
style="white-space:pre">	</span>&lt;xsd:attributeGroup \
name=&quot;osdAttributes&quot;&gt;</div> <div><span style="white-space:pre">	</span>  \
&lt;xsd:attribute name=&quot;osdActive&quot; type=&quot;xsd:boolean&quot; \
use=&quot;optional&quot;/&gt;</div><div><span style="white-space:pre">	</span>     \
&lt;xsd:attribute name=&quot;osdDuration&quot; type=&quot;xsd:int&quot; \
use=&quot;optional&quot;/&gt;</div>


<div><span style="white-space:pre">	</span>     &lt;xsd:attribute \
name=&quot;osdType&quot; type=&quot;xsd:int&quot; \
use=&quot;optional&quot;/&gt;</div><div><span style="white-space:pre">	</span>     \
&lt;xsd:attribute name=&quot;osdLocation&quot; type=&quot;xsd:int&quot; \
use=&quot;optional&quot;/&gt;</div>


<div><span style="white-space:pre">	</span>&lt;/xsd:attributeGroup&gt;</div></div><div><div><span \
style="white-space:pre">	</span>&lt;xsd:complexType \
name=&quot;streamAttributes&quot;&gt;</div> <div>                &lt;xsd:attribute \
name=&quot;channelNumber&quot; type=&quot;xsd:int&quot; \
use=&quot;required&quot;/&gt;</div><div>                &lt;xsd:attribute \
name=&quot;sourcePort&quot; type=&quot;xsd:int&quot; \
use=&quot;required&quot;/&gt;</div>


<div>                &lt;xsd:attribute name=&quot;sourceAddress&quot; \
type=&quot;xsd:string&quot; use=&quot;required&quot;/&gt;</div><div>                \
&lt;xsd:attribute name=&quot;targetPort&quot; type=&quot;xsd:int&quot; \
use=&quot;required&quot;/&gt;</div>


<div>                &lt;xsd:attribute name=&quot;targetAddress&quot; \
type=&quot;xsd:string&quot; use=&quot;required&quot;/&gt;</div><div>                \
&lt;xsd:attribute name=&quot;level&quot; type=&quot;xsd:byte&quot; \
use=&quot;required&quot;/&gt;</div>


<div>                &lt;xsd:attribute name=&quot;mutationInterval&quot; \
type=&quot;xsd:long&quot; use=&quot;required&quot;/&gt;</div><div>                \
&lt;xsd:attribute name=&quot;insertionInterval&quot; type=&quot;xsd:long&quot; \
use=&quot;required&quot;/&gt;</div>


<div>                &lt;xsd:attribute name=&quot;type&quot; \
type=&quot;xsd:byte&quot; use=&quot;required&quot;/&gt;</div><div>                \
&lt;xsd:attribute name=&quot;description&quot; type=&quot;xsd:string&quot; \
use=&quot;required&quot;/&gt;</div>


<div>                &lt;xsd:attribute name=&quot;ID&quot; \
type=&quot;xsd:string&quot; use=&quot;required&quot;/&gt;</div><div>                \
&lt;xsd:attributeGroup ref=&quot;ns:ccAttributes&quot; /&gt;</div><div>               \
&lt;xsd:attributeGroup ref=&quot;ns:osdAttributes&quot; /&gt;</div>


<div>            &lt;/xsd:complexType&gt;</div></div><div>...</div><div><br></div><div>So, \
how could I coerce the axis2 generator to behave like axis1 in this particular \
issue?</div><div><br></div><div>Thanks in advance,</div>


<div>--Luis R.</div>
</div></div></div><br>
</div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic