[
https://issues.apache.org/jira/browse/AXIS2C-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Lazarski resolved AXIS2C-1275.
-------------------------------------
Fix Version/s: 2.0.0
Resolution: Fixed
When creating an element with NULL namespace under a parent that has a
default namespace (xmlns="..."), the child element now gets an explicit
xmlns="" declaration to undeclare the inherited default namespace.
This ensures correct XML namespace semantics and proper canonicalization
for XML signatures. Previously, a child with NULL namespace would
serialize without xmlns="", causing XML processors to interpret it as
inheriting the parent's default namespace, which differs from the
internal AXIOM representation.
The fix is based on the Java Axiom implementation in
NSUtil.handleNamespace()
which handles this same case by adding a default namespace undeclaration.
> Axiom default namespace serialization and deserialization are not compatible
> ----------------------------------------------------------------------------
>
> Key: AXIS2C-1275
> URL: https://issues.apache.org/jira/browse/AXIS2C-1275
> Project: Axis2-C
> Issue Type: Bug
> Components: xml/om
> Reporter: Manjula Peiris
> Priority: Major
> Fix For: 2.0.0
>
>
> For the following code axiom generates the xml given below.
> ns1 = axiom_namespace_create (env, "http://example.org/", NULL);
> ping_ele = axiom_element_create(env, NULL, "PingResponse", ns1,
> &ping_node);
> echo_om_ele = axiom_element_create(env, ping_node, "echoStringResponse",
> NULL, &echo_om_node);
> text_om_ele = axiom_element_create(env, echo_om_node, "EchoStringReturn",
> NULL, &text_om_node);
> axiom_element_set_text(text_om_ele, env, text, text_om_node);
> <PingResponse xmlns="http://example.org/" >
> <echoStringResponse>
> <EchoStringReturn>text</EchoStringReturn>
> </echoStringResponse>
> </PingResponse>
> But when signing this om the child elements are not canonicalized with the
> namaspaces because those elements are created with NULL namespaces. But the
> the child elements inherit the default namespaces. So signature verification
> fails.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]