[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><xsd:attributeGroup \
name="ccAttributes"></div> <div><span style="white-space:pre"> </span> \
<xsd:attribute name="ccCGMS_A" type="xsd:int" \
use="optional"/></div><div><span style="white-space:pre"> </span> \
<xsd:attribute name="ccACP" type="xsd:int" \
use="optional"/></div>
<div><span style="white-space:pre"> </span> <xsd:attribute \
name="ccDwightCavendish" type="xsd:boolean" \
use="optional"/></div><div><span style="white-space:pre"> </span> \
<xsd:attribute name="ccHDCP" type="xsd:boolean" \
use="optional"/></div>
<div><span style="white-space:pre"> </span></xsd:attributeGroup></div><div><span \
style="white-space:pre"> </span><xsd:attributeGroup \
name="osdAttributes"></div> <div><span style="white-space:pre"> </span> \
<xsd:attribute name="osdActive" type="xsd:boolean" \
use="optional"/></div><div><span style="white-space:pre"> </span> \
<xsd:attribute name="osdDuration" type="xsd:int" \
use="optional"/></div>
<div><span style="white-space:pre"> </span> <xsd:attribute \
name="osdType" type="xsd:int" \
use="optional"/></div><div><span style="white-space:pre"> </span> \
<xsd:attribute name="osdLocation" type="xsd:int" \
use="optional"/></div>
<div><span style="white-space:pre"> </span></xsd:attributeGroup></div></div><div><div><span \
style="white-space:pre"> </span><xsd:complexType \
name="streamAttributes"></div> <div> <xsd:attribute \
name="channelNumber" type="xsd:int" \
use="required"/></div><div> <xsd:attribute \
name="sourcePort" type="xsd:int" \
use="required"/></div>
<div> <xsd:attribute name="sourceAddress" \
type="xsd:string" use="required"/></div><div> \
<xsd:attribute name="targetPort" type="xsd:int" \
use="required"/></div>
<div> <xsd:attribute name="targetAddress" \
type="xsd:string" use="required"/></div><div> \
<xsd:attribute name="level" type="xsd:byte" \
use="required"/></div>
<div> <xsd:attribute name="mutationInterval" \
type="xsd:long" use="required"/></div><div> \
<xsd:attribute name="insertionInterval" type="xsd:long" \
use="required"/></div>
<div> <xsd:attribute name="type" \
type="xsd:byte" use="required"/></div><div> \
<xsd:attribute name="description" type="xsd:string" \
use="required"/></div>
<div> <xsd:attribute name="ID" \
type="xsd:string" use="required"/></div><div> \
<xsd:attributeGroup ref="ns:ccAttributes" /></div><div> \
<xsd:attributeGroup ref="ns:osdAttributes" /></div>
<div> </xsd:complexType></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