You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Olivier Moïses <om...@nordnet.fr> on 2004/09/04 17:57:34 UTC
Where are attribute's namespace prefixes after serialization ??
Hi all,
I try since weeks to use Axis 1.1 and ebxmlms from cecid
(http://sourceforge.net/projects/ebxmlms/).
In fact, when I link my ebxmlms code with jaas.jar from axis-1.1
(instead of jaas-api/ jaas-ri from sun), the serialization process fail,
and my existing code does'nt work.
In fact, somewhere in the message, ebxmlms wait for this :
<eb:Reference eb:id="payload1" xlink:type="simple" xlink:href="cid:payload1" .....
but Axis serialize this
<eb:Reference id="payload1" type="simple" href="cid:payload1" ...
Attribute prefixes are missing.
After many code introspections, I finally found a way to patch the Axis code.
In class org.apache.axis.encoding.SerializationContext, function startElement, I modify original code :
if (uri != null && uri.length() > 0) {
if (qname.length() == 0) {
// If qname isn't set, generate one
prefix = getPrefixForURI(uri);
} else {
// If it is, make sure the prefix looks reasonable.
int idx = qname.indexOf(':');
-------------------------------------------------------------------
original code
if (idx > -1) {
prefix = qname.substring(0, idx);
prefix = getPrefixForURI(uri,
prefix, true);
}
-------------------------------------------------------------------
patched code
if (idx > -1)
prefix = qname.substring(0, idx);
prefix = getPrefixForURI(uri,
prefix, true);
-------------------------------------------------------------------
}
if (prefix.length() > 0) {
qname = prefix + ':' + attributes.getLocalName(i);
} else {
qname = attributes.getLocalName(i);
}
}
BUT i am not sure to be on the right way.
Is there any way in axis to force usage of namespace's attributes ? Why are the prefixes not here ?
The same problem occurs with axes 1.2 beta.
Thanks,
Olivier Moises