axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
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
       Body:
I somehow expected that answer ;)

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

This is a nice explanation of substitutionGroups
http://www.cs.technion.ac.il/~oshmu/Substitution%20Groups.ppt

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">
<sequence>
<element ref="a"/>
</sequence>
</complexType>
<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"));
typeDesc.addAsSubstitutionGroupMember(
  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.

example:
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
round.

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 SymbolTable.java? - 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:
  http://issues.apache.org/jira/browse/AXIS-1353?page=comments#action_35465

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1353

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

     Status: Unassigned
   Priority: Major

    Project: Axis
   Versions:
             1.2 Beta

   Assignee: 
   Reporter: Dominic Battre

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

Description:
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)

http://xml.coverpages.org/bourretSchemaMap200103.html#substitution 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.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message