axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jira] Commented: (AXIS-1353) support for substitutionGroups
Date Sun, 09 May 2004 22:05:59 GMT
The following comment has been added to this issue:

     Author: Dominic Battre
    Created: Sun, 9 May 2004 3:05 PM
I somehow expected that answer ;)

Maybe someone can give me a hint on how to implement it.

This is a nice explanation of substitutionGroups

As far as I understand it, there is a substitutionGroup header of a certain type and substitutionGroup
members, whose types must be derived from the substitutionGroup header.

suppose this code is given:
<complexType name="BarType">
<element ref="a"/>
<element name="a" type="FooType"/>
<element name="b" type="DerivedFromFooType"/>

I would modify JavaBeanHelperWriter to add code like this to the static block of DerivedFromFooType
typeDesc.setXmlType(new QName("urn:", "DerivedFromFooType"));
  new QName("urn:","b"),
  new QName("urn:","BarType"),
  new QName("urn:","a") );

ie. the signature would be
typeDesc.addAsSubstitutionGroupMember(QName memberName, QName complexType, QName substitutionForMember);

This code shall look for the mapped class of "complexType", and register itself (the typeDesc)
as a replacement for "substitutionForMember".

The Bean(De)Serializer has to be adapted. Each time it wants to (de)serialize a member it
has to check the substitutionGroupMembers and choose the right one.

f = new BarType();
f.setA( new DerivedFromFooType() );

The BeanSerializer has to inspect the substitutionGroupMembers of "a". It finds a type "DerivedFromFooType".
If the member "a" of "BarType" is an instance of "DerivedFromFooType", we don't serialize
it to
<a>...</a> but to <b>...</b>. Deserialization works the other way

Do you like that approach?

How can one do the registration? - It is important that the subtitutionGroup head has registered
before the substitutionGroup members. How can that be achived in a static block?

How do I implement this in - what would be the approach for finding and
storing information on substitutionGroups. I have some difficulties understanding the code.

Maybe one of the gurus can give me some instructions. I will try to implement this then. You
can find me quite often in #apache-axis on freenode IRC. If noone else appears, I will bother
dims :-)
View this comment:

View the issue:

Here is an overview of the issue:
        Key: AXIS-1353
    Summary: support for substitutionGroups
       Type: New Feature

     Status: Unassigned
   Priority: Major

    Project: Axis
             1.2 Beta

   Reporter: Dominic Battre

    Created: Sun, 9 May 2004 7:54 AM
    Updated: Sun, 9 May 2004 3:05 PM

Currently Axis seems not to support substitutionGroups at all. Sadly they seem to be quite
important for current WS-* specifications. (esp. WS-Agreement I am working with) suggests mapping substitutionGroups
to xsd:choices. This is not perfect as all substitutionGroups have to be known in advance
when processing WSDL2Java - but at least a beginning.

What do you think about that?

This approach would fix bug AXIS-1219 as well.

This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:

If you want more information on JIRA, or have a bug to report see:

View raw message