axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Greif" <jgr...@alumni.princeton.edu>
Subject Re: Deserializing substitutionGroup and abstract types
Date Mon, 29 Jan 2007 17:27:43 GMT
Abstract types and substitution groups seem not to be well supported
in most web service machinery.  Even if you find a supporting
platform, there may be interoperability problems if clients use other
platforms.  You might have an easier time getting something like this
to work:

<element name="sequence" type="tns:Workflow"/>
<element name="parallel" type="tns:Workflow"/>
<element name="pipeline" type="tns:Pipeline"/>

<complexType name="Workflow">
   <choice maxOccurs="unbounded">
      <element ref="sequence"/>
      <element ref="parallel"/>
      <element ref="pipeline"/>
    </choice>
</complexType>

<complexType name="Pipeline">
   ...
</complexType>

Jeff

On 1/29/07, Amy Krause <amrey@epcc.ed.ac.uk> wrote:
> Hi,
>
> I'm having a very similar problem as described here:
> http://marc.theaimsgroup.com/?l=axis-user&m=113819830006177&w=2
>
> My schema is included below.
> I'm trying to implement a composite pattern. There are three types derived
> from an abstract type as follows:
>
>          Workflow (abstract)
>         /         |        \
>     Parallel   Sequence  Pipeline
>
> Both parallel and sequence elements must contain nested Workflow elements
> (one or more of parallel, sequence or pipeline), whereas pipeline elements
> cannot - they form the leaves of the workflow tree.
> An example of a document would be:
>
> <perform>
>    <sequence>
>      <parallel>
>        <pipeline> ... </pipeline>
>        <pipeline> ... </pipeline>
>      </parallel>
>      <pipeline> ... </pipeline>
>    </sequence>
> <perform>
>
> In the schema I've defined an abstract Workflow element and elements
> parallel, sequence and pipeline. These are substitution elements for the
> Workflow element.
> When I generate Java beans with WSDL2Java there is no trace of the
> parallel and sequence elements. There is a Java class called Composite
> which extends WorkflowComponent but there is no way of telling whether
> this Composite object used to be a sequence or a parallel element. How can
> I force Axis to generate Java beans corresponding to those elements?
>
> Any help with this would be appreciated.
>
> Thanks,
> Amy
>
>
>
>   <!-- root element -->
>   <xsd:element name="perform">
>      <xsd:complexType>
>        <xsd:sequence>
>          <xsd:element ref="tns:workflow"/>
>        </xsd:sequence>
>      </xsd:complexType>
>    </xsd:element>
>
>    <!-- work flow group and component -->
>
>    <xsd:element name="workflow" abstract="true"
>                 type="tns:WorkflowComponent">
>    </xsd:element>
>
>    <xsd:complexType name="WorkflowComponent">
>    </xsd:complexType>
>
>    <xsd:element name="parallel"
>                 substitutionGroup="tns:workflow"
>                 type="tns:Composite"/>
>    <xsd:element name="sequence"
>                 substitutionGroup="tns:workflow"
>                 type="tns:Composite"/>
>
>    <xsd:complexType name="Composite">
>      <xsd:complexContent>
>        <xsd:extension base="tns:WorkflowComponent">
>          <xsd:sequence>
>            <xsd:element ref="tns:workflow" maxOccurs="unbounded"/>
>          </xsd:sequence>
>        </xsd:extension>
>      </xsd:complexContent>
>    </xsd:complexType>
>
>    <xsd:element name="pipeline"
>                 substitutionGroup="tns:workflow"
>                 type="tns:Pipeline"/>
>
>    <xsd:complexType name="Pipeline">
>      <xsd:complexContent>
>        <xsd:extension base="tns:WorkflowComponent">
>          <xsd:sequence>
>            <xsd:element ref="tns:activity" minOccurs="1"
>                                            maxOccurs="unbounded"/>
>          </xsd:sequence>
>        </xsd:extension>
>      </xsd:complexContent>
>    </xsd:complexType>
>
>    <xsd:element name="activity">
>       <!-- some definitions here ... -->
>    </xsd:element>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message