You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by "Masahiro Kurosawa (JIRA)" <ji...@apache.org> on 2005/10/07 11:30:47 UTC

[jira] Created: (APOLLO-48) The return value of XmlBeansResourcePropertySet.toXmlObject() is sometimes invalid

The return value of XmlBeansResourcePropertySet.toXmlObject() is sometimes invalid
----------------------------------------------------------------------------------

         Key: APOLLO-48
         URL: http://issues.apache.org/jira/browse/APOLLO-48
     Project: WSRF
        Type: Bug
  Components: ResourceProperties  
    Reporter: Masahiro Kurosawa
    Priority: Blocker


The return value of XmlBeansResourcePropertySet.toXmlObject() is sometimes against the order of elements defined in schema of resource property document. For example, even if the schema is like this:
============
<xsd:element name="SampleProperties">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element ref="wsrl:CurrentTime"/>
      <xsd:element ref="wsrl:TerminationTime"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>
============
when resource class add the resources to XmlBeansResourcePropertySet instance like this:
============
        prop = this.propSet.get( 
            ScheduledResourceTerminationPortType.PROP_QNAME_TERMINATION_TIME );
        TerminationTimeDocument termTime = TerminationTimeDocument.Factory.newInstance();
        termTime.setNilTerminationTime();
        prop.add( termTime );

        ResourceProperty prop = this.propSet.get( 
            ScheduledResourceTerminationPortType.PROP_QNAME_CURRENT_TIME );
        CurrentTimeDocument currTime = CurrentTimeDocument.Factory.newInstance();
        currTime.setCurrentTime( Calendar.getInstance() );
        prop.add( currTime );
        prop.setCallback( new CurrentTimeCallback() );
============
the return value of XmlBeansResourcePropertySet.toXmlObject() is:
============
<xxx:SampleProperties ...>
  <wsrf:TerminationTime ...> ... </wsrf:TerminationTime>
  <wsrf:CurrentTime ...> ... </wsrf:CurrentTime>
 </xxx:SampleProperties>
============

This XML document is against the schema, and therefore invalid.

I think XmlBeansResourceProperty.add() causes this because it adds the given resource property element as just last child element of the resource properties document using XmlBeanUtils.addChildElement(), not considering the order defined in schema.

This is FATAL since response message of wsrf-rp:GetResourcePropertiesDocument operation might be invalid.

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira