Type Substitution over web services?

E

Elhanan

hi..

can i expose this schema and be sure that consumers like dotnet would
be able to do xml binding even though i have inheritence in this xsd?
is this interopble?

i have the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://example.org/"

xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc ="http://java.sun.com/xml/ns/jaxb/xjc"
jaxb:extensionBindingPrefixes="xjc"
jaxb:version="1.0"
<xsd:annotation>
<xsd:appinfo>
<jaxb:globalBindings>
<xjc:typeSubstitution type="complex"/>
</jaxb:globalBindings>
</xsd:appinfo>
</xsd:annotation>

<xsd:complexType name="BaseItem" abstract="true" >
<xsd:attribute name="Id" type="xsd:int"/>
<xsd:attribute name="Price" type="xsd:int"/>
</xsd:complexType>

<xsd:complexType name="Book">
<xsd:complexContent>
<xsd:extension base="BaseItem">
<xsd:attribute name="Name" type="xsd:string" />
<xsd:attribute name="year" type="xsd:int" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

<xsd:complexType name="TV">
<xsd:complexContent>
<xsd:extension base="BaseItem">
<xsd:attribute name="Brand" type="xsd:string" />
<xsd:attribute name="Type" type="xsd:string" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

<xsd:element name="Store">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Items" type="BaseItem" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top