You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2007/12/18 01:26:43 UTC

[jira] Created: (SYNAPSE-196) Inconsistent namespace resolution

Inconsistent namespace resolution
---------------------------------

                 Key: SYNAPSE-196
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-196
             Project: Synapse
          Issue Type: Bug
          Components: Core
    Affects Versions: NIGHTLY
            Reporter: Andreas Veithen
            Priority: Minor
         Attachments: namespace-patch.txt

In synapse.xml, resolution of namespace prefixes for SOAP fault codes (<code> element) and headers (<header> element) only works if the namespace is declared on the element itself, but not if it is declared on an ancestor of the element. For example, the following declaration will result in an error if the regsoap prefix is defined on the root element:

<header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes"/>

Currently this only works if the namespace is declared on the <header> element:

<header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes" xmlns:regsoap="urn:freebxml:registry:soap"/>

This behavior is a rather unusual for XML documents and is also inconsistent with the behavior for XPath expressions appearing in synapse.xml (where resolution of namespace prefixes works as expected).

To solve this issue, the following changes would be required:

* Modify OMElementUtils.getNameSpaceWithPrefix (which is used exclusively by FaultMediatorFactory) to recursively scan elements for namespace declarations, starting from the element passed as argument up to the root element and stopping on the first matching namespace prefix.
* Modify HeaderMediatorFactory to use OMElementUtils.getNameSpaceWithPrefix as well (for the moment it uses a piece of code that is similar to the current implementation of OMElementUtils.getNameSpaceWithPrefix).

A proposed patch is attached.

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


[jira] Updated: (SYNAPSE-196) Inconsistent namespace resolution

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

Andreas Veithen updated SYNAPSE-196:
------------------------------------

    Attachment:     (was: namespace-patch.txt)

> Inconsistent namespace resolution
> ---------------------------------
>
>                 Key: SYNAPSE-196
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-196
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: NIGHTLY
>            Reporter: Andreas Veithen
>            Priority: Minor
>         Attachments: namespace-patch.txt
>
>
> In synapse.xml, resolution of namespace prefixes for SOAP fault codes (<code> element) and headers (<header> element) only works if the namespace is declared on the element itself, but not if it is declared on an ancestor of the element. For example, the following declaration will result in an error if the regsoap prefix is defined on the root element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes"/>
> Currently this only works if the namespace is declared on the <header> element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes" xmlns:regsoap="urn:freebxml:registry:soap"/>
> This behavior is a rather unusual for XML documents and is also inconsistent with the behavior for XPath expressions appearing in synapse.xml (where resolution of namespace prefixes works as expected).
> To solve this issue, the following changes would be required:
> * Modify OMElementUtils.getNameSpaceWithPrefix (which is used exclusively by FaultMediatorFactory) to recursively scan elements for namespace declarations, starting from the element passed as argument up to the root element and stopping on the first matching namespace prefix.
> * Modify HeaderMediatorFactory to use OMElementUtils.getNameSpaceWithPrefix as well (for the moment it uses a piece of code that is similar to the current implementation of OMElementUtils.getNameSpaceWithPrefix).
> A proposed patch is attached.

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


[jira] Updated: (SYNAPSE-196) Inconsistent namespace resolution

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

Andreas Veithen updated SYNAPSE-196:
------------------------------------

    Attachment: namespace-patch.txt

> Inconsistent namespace resolution
> ---------------------------------
>
>                 Key: SYNAPSE-196
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-196
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: NIGHTLY
>            Reporter: Andreas Veithen
>            Priority: Minor
>         Attachments: namespace-patch.txt
>
>
> In synapse.xml, resolution of namespace prefixes for SOAP fault codes (<code> element) and headers (<header> element) only works if the namespace is declared on the element itself, but not if it is declared on an ancestor of the element. For example, the following declaration will result in an error if the regsoap prefix is defined on the root element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes"/>
> Currently this only works if the namespace is declared on the <header> element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes" xmlns:regsoap="urn:freebxml:registry:soap"/>
> This behavior is a rather unusual for XML documents and is also inconsistent with the behavior for XPath expressions appearing in synapse.xml (where resolution of namespace prefixes works as expected).
> To solve this issue, the following changes would be required:
> * Modify OMElementUtils.getNameSpaceWithPrefix (which is used exclusively by FaultMediatorFactory) to recursively scan elements for namespace declarations, starting from the element passed as argument up to the root element and stopping on the first matching namespace prefix.
> * Modify HeaderMediatorFactory to use OMElementUtils.getNameSpaceWithPrefix as well (for the moment it uses a piece of code that is similar to the current implementation of OMElementUtils.getNameSpaceWithPrefix).
> A proposed patch is attached.

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


[jira] Updated: (SYNAPSE-196) Inconsistent namespace resolution

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

Andreas Veithen updated SYNAPSE-196:
------------------------------------

    Attachment: namespace-patch.txt

There is also another issue related to this: FaultMediatorFactory doesn't check the result of OMElementUtils#getNameSpaceWithPrefix. This might lead to unexpected results. Attached a new version of the patch that also resolves this.

> Inconsistent namespace resolution
> ---------------------------------
>
>                 Key: SYNAPSE-196
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-196
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: NIGHTLY
>            Reporter: Andreas Veithen
>            Priority: Minor
>         Attachments: namespace-patch.txt
>
>
> In synapse.xml, resolution of namespace prefixes for SOAP fault codes (<code> element) and headers (<header> element) only works if the namespace is declared on the element itself, but not if it is declared on an ancestor of the element. For example, the following declaration will result in an error if the regsoap prefix is defined on the root element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes"/>
> Currently this only works if the namespace is declared on the <header> element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes" xmlns:regsoap="urn:freebxml:registry:soap"/>
> This behavior is a rather unusual for XML documents and is also inconsistent with the behavior for XPath expressions appearing in synapse.xml (where resolution of namespace prefixes works as expected).
> To solve this issue, the following changes would be required:
> * Modify OMElementUtils.getNameSpaceWithPrefix (which is used exclusively by FaultMediatorFactory) to recursively scan elements for namespace declarations, starting from the element passed as argument up to the root element and stopping on the first matching namespace prefix.
> * Modify HeaderMediatorFactory to use OMElementUtils.getNameSpaceWithPrefix as well (for the moment it uses a piece of code that is similar to the current implementation of OMElementUtils.getNameSpaceWithPrefix).
> A proposed patch is attached.

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


[jira] Resolved: (SYNAPSE-196) Inconsistent namespace resolution

Posted by "indika priyantha kumara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

indika priyantha kumara resolved SYNAPSE-196.
---------------------------------------------

    Resolution: Fixed

Hi Andreas

Applied your patch . Thanks for fixing issue . 

Thanks

Indika

> Inconsistent namespace resolution
> ---------------------------------
>
>                 Key: SYNAPSE-196
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-196
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: NIGHTLY
>            Reporter: Andreas Veithen
>            Priority: Minor
>         Attachments: namespace-patch.txt
>
>
> In synapse.xml, resolution of namespace prefixes for SOAP fault codes (<code> element) and headers (<header> element) only works if the namespace is declared on the element itself, but not if it is declared on an ancestor of the element. For example, the following declaration will result in an error if the regsoap prefix is defined on the root element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes"/>
> Currently this only works if the namespace is declared on the <header> element:
> <header name="regsoap:capabilities" value="urn:freebxml:registry:soap:modernFaultCodes" xmlns:regsoap="urn:freebxml:registry:soap"/>
> This behavior is a rather unusual for XML documents and is also inconsistent with the behavior for XPath expressions appearing in synapse.xml (where resolution of namespace prefixes works as expected).
> To solve this issue, the following changes would be required:
> * Modify OMElementUtils.getNameSpaceWithPrefix (which is used exclusively by FaultMediatorFactory) to recursively scan elements for namespace declarations, starting from the element passed as argument up to the root element and stopping on the first matching namespace prefix.
> * Modify HeaderMediatorFactory to use OMElementUtils.getNameSpaceWithPrefix as well (for the moment it uses a piece of code that is similar to the current implementation of OMElementUtils.getNameSpaceWithPrefix).
> A proposed patch is attached.

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