WSDL11ToAxisServiceBuilder + Multiple Bindings + RPC/Literal OR HTTP binding =~ 
Inconsistent XMLSchema object: duplicated global element declarations
-----------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-4071
                 URL: https://issues.apache.org/jira/browse/AXIS2-4071
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: 1.4, nightly
         Environment: Windows XP. 4GB RAM Intel Xeon dual-core @2.75Ghz
            Reporter: Antonio Andrade


In WSDL11ToAxisServiceBuilder:
1) Within the 'setup()' method, a map ('schemaMap') indexed by targetNamespace 
and values equal root (W3C) Elements is populated
2) When either a RPC/Literal binding or an HTTP binding with message parts 
referencing type definitions is found, new global element declarations based on 
the WSDL operation name are created. These new elements can either be added to 
an existing (W3C) Document (in case the 'schemMap'  contains a document with 
the same target namespace as the one that the newly created element has) or 
added to a newly created Document.:
  a) If a new document is created, an additional namespace mapping declaration 
is added to that document (see 'XMLNS_AXIS2WRAPPED' ). This helps 
distinguishing this document among the other original ones.
 b) If an additional document is NOT created, the new global element 
declarations are added to an existing document. No additional namespace mapping 
declaration is added.
3) After all wrapped elements have been created,  XmlSchema objects are created 
from the original, modified and newly created W3C Documents
Note that all this leads to duplicate global element declarations any time 
there's already an element named after an operation name. This is very common 
and happens every time operation names across multiple bindings are the same.  
In general, all this is caused by the creation of XML schema elements while 
transforming operations using the RPC/Literal encoding style into the 
Document/Literal encoding style using the wrapped convention.
There is more than one problem associated with the creation of new XML global 
element declarations:
1) First of all, the XML schema documents end up with duplicated global element 
declarations which makes the Schema invalid. But why nobody seems to have 
noticed it? I think it's just a coincidence, let me explain: A XmlSchema object 
maintains a MAP, indexed by element name (QName) and XmlSchemaElement objects 
as values. This map is used for a faster object retrieval. At the same time, 
the XmlSchema object also maintains a LIST of all nodes (XmlSchemaObject 
objects I think). So whenever duplicate elements are added to the schema, the 
last-inserted elements overwrite the previous elements on the MAP of elements 
but they are inserted with no problems in the LIST of nodes and because the 
latter elements are usually what people is looking for (i.e. in case of 
databinding libraries that create the client stub for a single port), the 
'correct' element is returned
2) If the Definition object (from WSDL4J) is used to populate multiple 
AxisServices from different WSDL ports, for example, within the 
'WSDL11ToAllAxisServicesBuilder' (which, by the way doesn't seem to work at 
all), the W3C Schema Document may end up with multiple duplicated global 
element declarations and the 'AxisService.getSchemaElement(QName)' method will 
fail to return the appropriate reference.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to