You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Antonio Andrade (JIRA)" <ji...@apache.org> on 2008/10/07 02:11:44 UTC

[jira] Created: (AXIS2-4071) WSDL11ToAxisServiceBuilder + Multiple Bindings + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Antonio Andrade (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Andrade updated AXIS2-4071:
-----------------------------------

    Attachment: AXIS2-4071.patch

Submitting patch. Ready for review:

It's very important to note that the duplication of global element declarations doesn't come from the WSDLs themselves -i.e. the WSDL is perfectly valid- but from the fact that Axis2 converts other supported encoding styles into the Document/Literal encoding style using the WRAPPED convention. This provides significant advantages, like data abstraction and consistent processing of type definitions for different binding types but has some side effects (i.e. this bug). The "fix" for this bug is not trivial; I think it's a trade-off so is important to keep in mind what we gain/loose with the different approaches that can be taken.

I think that throwing an exception whenever a collision is detected have two important implications: one technical and one conceptual, and may not be the best thing to do. Technically, it would not be that simple -I think- since the collisions may occur at any level inside imported XML schema documents (which may add more complexity to the code and harm performance); Conceptually, there may not be a justification for failing to parse the WSDL model since the non-validity of the XML schema documents comes from Axis2, not from the WSDL definition.

The attached patch is driven by the premise that 'internal data handling should not have any side effect on any external data structure'.

a)  It's ok to create new elements but not within the original XML schema documents which may be used/reused outside of the WSDL11ToAxisServiceBuilder class and that's why that part of the code was removed in favor of always creating a separate XML schema document that can isolate all 'internally' created elements.  Creating the new elements in different documents (each for targetnamespace involved) doesn't solve the duplication problem but clearly separates the original documents from the created ones.

b) As described in the bug's description, a namespace binding declaration (XMLNS_AXIS2WRAPPED) was used to 'mark' these new schema documents. This is important because it can be used to consistently identify the presence of new elements, which can be used to later determine if an actual duplication problem exists or not. Previously, new elements could end up being inserted into existing documents, which 1) is not ideal because of described above and 2) would add additional complexity while finding duplicated elements declarations

c) Since the duplication problem still exists, the 'AxisService.getSchemaElement' method was updated to start looking the element in the last-inserted schema document. This may be more intuitive since elements declarations in the last schema document added would seem to ""overwrite"" previous ones.

d) Because in these type of global element element collisions nobody but the the client knows which element is the "right" one to be used, clients interested in resolving the collisions would need to remove/detach the conflicted schema document from the list of schema documents saved into an AxisService object (i.e. getting the schema document list through the 'AxisService .getSchema' method and detaching the conflicting schema. Note: original schema documents may not be able to be removed due to possible dependencies between other imported documents and the original document).

Again, I don't think any 'fix' for this bug would be trivial. I strongly feel that the patch being submitted is the cleanest way to handle this but there may be things that I'm overlooking so hopefully this will be reviewed and eventually committed into trunk.

> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644251#action_12644251 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4071:
-----------------------------------------------------

Sorry for late reply.

Are you thinking of custermizing the Axis2?

WSDL11ToAxisServiceBuilder is used in codegen and deployment. Have you test your modified code with code gen and deployment?

For the both cases uses it runs with the default WSDL11ToAxisServiceBuilder and there is no way to plug any other WSDL11ToAxisServiceBuilder. Are you suggesting to have such feature?

In above case also what I would like to suggest is to extract the code which adds the generated elements/complex types for existing schema. So for normal case the existing code run as it is and if some one need they can override it.



> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch, JUnit Tests - Before.jpg
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Antonio Andrade (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Andrade updated AXIS2-4071:
-----------------------------------

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

  was:
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.

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

> WSDL11ToAxisServiceBuilder + 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
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Boris Milanov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749848#action_12749848 ] 

Boris Milanov commented on AXIS2-4071:
--------------------------------------

Hi,

We are also experiencing problems with the duplicate elements.
Is there any chance that this JIRA will be fixed soon?

> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch, JUnit Tests - Before.jpg
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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.


[jira] Commented: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642429#action_12642429 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4071:
-----------------------------------------------------

hi Antonio,

As I mentioned earlier the problem is that if there are element with the same name already exists in the same name space where WSDL11ToAxisServiceBuilder creates new elements, then there is an error but WSDL11ToAxisServiceBuilder does not report that properly.
Here I agree with you that this is a limitation comes with the Axis2 implementation and IMHO that is not something we can fix now. 

As I saw In your solution you populate the new elements to a new different schema. How this solves the earlier problem? In the way Axis2 data binding and Axis2 object hierarchy is written it is very difficult to support this kind of WSDL file. 

So if I understand correctly there is no feature addition from the user point of view. The only improvement can be done is to throw a proper exception.



> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch, JUnit Tests - Before.jpg
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Antonio Andrade (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642476#action_12642476 ] 

Antonio Andrade commented on AXIS2-4071:
----------------------------------------

Hi Amila, first of all, thank you for your comments.

I mentioned twice that the "fix" (quoted) didn't solve the duplication problem but it avoids side effects on external data structures (original schema documents) but I think I also implied (in another part) that the patch "fixes" the problem, sorry about that.

I'd be totally ok to throw an exception if a WSDL with those properties was difficult to find but I don't think that's the case (or what do you think?). I just run some internal tests and from 311 WSDL documents I'm testing with, 39 lead to this duplication problem (12%). 

I would agree throwing an exception is there's a way to make it optional and delegate the responsibility of resolving any conflicts to the client. I can submit the patch and the JUnit Tests, no problem. What do you think?

So basically, after the schemas have been created, the 'populateService' method can call a protected method (i.e. validateXmlSchemas) which by default throws an exception when duplicated global elements declarations are found. Subclasses can then decide to overwrite the 'validateXmlSchemas' method and do something different (i.e. do not throw exception but resolve in a client-specific way the duplication of these elements). The already submitted patch would remain pretty much the same (wrapped elements would be created always into NEW XML schema documents) and the 'validateXmlSchemas' method would be added. What do you think?



> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch, JUnit Tests - Before.jpg
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Antonio Andrade (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Andrade updated AXIS2-4071:
-----------------------------------

    Attachment: JUnit Tests - Before.jpg

Attaching screenshot of JUnit Tests results before the patch. The test case asserts:

1) That there are duplicated elements in the scenarios described above both for RPC literal and HTTP bindings.

2) That the wrapped elements (i.e. internally-created elements) are injected into a NEW XML schema document, not in the original documents.

3) That the XML schema document containing wrapped elements contains a namespace binding declaration that identifies the schema as an internally-created one.





> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch, JUnit Tests - Before.jpg
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Resolved: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-4071.
-------------------------------------------------

    Resolution: Fixed

fixed with the revision 814572

Now a new element added to xml schema only if the element is not available.

> WSDL11ToAxisServiceBuilder + 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
>         Attachments: AXIS2-4071.patch, JUnit Tests - Before.jpg
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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.


[jira] Commented: (AXIS2-4071) WSDL11ToAxisServiceBuilder + RPC/Literal OR HTTP binding =~ Inconsistent XMLSchema object: duplicated global element declarations

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637782#action_12637782 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4071:
-----------------------------------------------------

As you have mentioned this global element duplication problem is there. There was an issue for this but I can not remember the number.
In RPC literal case if there is an already declared element within the same namespace. then it should through an exception. 
Can you please attach a patch?

> WSDL11ToAxisServiceBuilder + 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
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> 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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org