Bug 3513 - Topic Dialect serialized incorrectly causing interoperability problems
: Topic Dialect serialized incorrectly causing interoperability problems
Status: RESOLVED FIXED
: Java WS Core
globus_wsrf_core
: 4.0.0
: PC Windows XP
: P3 critical
: ---
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2005-06-23 10:47 by
Modified: 2005-07-19 14:43 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-06-23 10:47:41
Topics exposed in the resource properties are serialized incorrectly.

For example:

<ns4:Topic
ns4:Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple" 
xmlns:ns3="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-
1.2-draft-01.xsd" xmlns:ns4="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-
BaseNotification-1.2-draft-01.xsd" 
xmlns="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-
draft-01.xsd">
ns3:ResourceTermination</ns4:Topic>

The problem is that the dialect is qualified with a namespace (ns4:).

Because the WS-BaseN schema has attributeFormDefault="unqualified", all 
attributes declared in the schema are expected to be unqualified. Also, since 
the type definition for TopicExpressionType does not include an 
xs:anyAttribute element, the presence of the ns4:Dialect element actually 
makes the XML above invalid.

The TypeDesc in GT4's TopicExpressionType class contains:

   attrField.setXmlName(new javax.xml.namespace.QName("", DIALECT_ATTR)); 

which is correct.

The problem is in wsrf/encoding/TopicExpressionSerializer which contains the 
definition

    private static final QName ATTR = 
        new QName(TopicExpressionType.NAMESPACE, 
                  TopicExpressionType.DIALECT_ATTR);


This definition should actually be:


    private static final QName ATTR = 
        new QName("", 
                  TopicExpressionType.DIALECT_ATTR);

which is equivalent to the attribute QName from the TopicExpressionType class.

This give the correct result:

<ns4:Topic
Dialect="http://docs.oasis-open.org/wsn/2004/06/TopicExpression/Simple" 
xmlns:ns3="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceLifetime-
1.2-draft-01.xsd" xmlns:ns4="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-
BaseNotification-1.2-draft-01.xsd" 
xmlns="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-
draft-01.xsd">
ns3:ResourceTermination</ns4:Topic>


The deserializer has the same structure, although in the underlying base class 
DialectDependentDeserializer actually will accept both a null (correct) or 
namespace qualified (incorrect) attribute. Given there are likely to be 
unpatched GT4.0.0 systems around, it may be best to leave the deserializer 
alone for the moment.
------- Comment #1 From 2005-06-23 17:42:49 -------
This is fixed now in cvs trunk. But it is not committed to globus_4_0_branch 
and will not show up in 4.0.1 as it might break existing compatibility with 
other implementations.
------- Comment #2 From 2005-07-19 14:43:52 -------
A "org.globus.dialect.attr.qualified " Java system property was added to 
configure how the 'dialect' attribute gets serialized. This change was 
committed to both trunk and globus_4_0_branch with one difference in the 
defaults. In trunk, by default, the dialect attribute will be serialized 
without the namespace (unqualified). In globus_4_0_branch, by default, the 
dialect attribute will be serialized with the namespace (qualified) - the same 
as before in 4.0.0. 
The system property can be set to 'true' to serialize with the namespace 
or 'false' to serialize without the namespace. This system property controls 
the 'dialect' attribute of the TopicExpressionType and QueryExpressionType.