You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Sky-Tiger <da...@gmail.com> on 2008/09/15 06:13:21 UTC
How CXF/JAXB deal with Xsd:any?
Dear all,
Please check the xml schema bellow:
<xsd:complexType name="OperationType">
<xsd:sequence>
<xsd:element name="operationLabel" type="xsd:string" minOccurs="0"/>
<xsd:element name="operationData" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
The operationData is xsd:any type. What does it really contain is
controlled by operationLabel.
So in such scenario, how does cxf deal with the xml message? In
JAXB, any type will be converted to java Object.
Regards
Hubert.
--
View this message in context: http://www.nabble.com/How-CXF-JAXB-deal-with-Xsd%3Aany--tp19487071p19487071.html
Sent from the cxf-dev mailing list archive at Nabble.com.
Re: How CXF/JAXB deal with Xsd:any?
Posted by Daniel Kulp <dk...@apache.org>.
In that case, the generated code would be a JAXBElement<Object>. What's in
that object would depend on what is sent on the wire. If, on the wire, that
element has an xsi:type attribute with a type that the current JAXBContext
knows about, the object will be deserialized into the appropriate JAXB
object. If jaxb DOESN'T know about it, it will be an DOM.
Dan
On Monday 15 September 2008 12:13:21 am Sky-Tiger wrote:
> Dear all,
> Please check the xml schema bellow:
> <xsd:complexType name="OperationType">
> <xsd:sequence>
> <xsd:element name="operationLabel" type="xsd:string" minOccurs="0"/>
> <xsd:element name="operationData" minOccurs="0">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:any namespace="##any" processContents="lax" minOccurs="0"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:element>
> </xsd:sequence>
> </xsd:complexType>
> The operationData is xsd:any type. What does it really contain is
> controlled by operationLabel.
> So in such scenario, how does cxf deal with the xml message? In
> JAXB, any type will be converted to java Object.
>
> Regards
>
> Hubert.
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog