Skip to Content
0
Former Member
Jul 27, 2006 at 11:33 AM

Problems with Virtual Interfaces (providing web services)

22 Views

Hi all,

I faced a problem with providing a web service that accepts data as discribed in a schema file (xsd).

I first analysed the schema and created the data classes according to it, as closest, as I could.

How can I realize such a ComplexType as class (MyCars.java):

<xs:schema xmlns:cars="Cars" targetNamespace="Cars">
  <xs:element name="MyCars">
    <xs:complexType>
      <xs:sequence>
        <xs:choice maxOccurs="unbounded">
          <xs:element ref="cars:Ford"/>
	  <xs:element ref="cars:Mercedes"/>
        </xs:choice>
        <xs:element ref="cars:CarPort" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<xs:schema xmlns:cars="Cars" targetNamespace="Cars">

Data that will be provided to the WebService might look like:

<MyCars xmlns="Cars">
  <Ford ... />
  <Mercedes ... />
  <Ford ... />
  <Ford ... />
  <Mercedes ... />

  <CarPort>5th Avenue</CarPort>
</MyCars>

Please help me and thanks in advance,

Paul