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 Michael Hoefer <mh...@niku.com> on 2005/04/28 02:46:29 UTC
Namespaces and Attributes in Axis 1.2
I have a question related to Axis 1.2RC3 w/r/t implementing w3c dom in
SAAJ1.2. Looking at the code, it is clear that Axis keeps namespace
declarations separate from normal attributes. I'm not a wunderkind when
it comes to the w3c specs but to make a long story short, the SOAPPart
'document' taken from a response message is either invalid or just does
not behave like any normal dom implementation.
I am in this case using Axis as a client via SAAJ1.2 MessageFactory,
ConnectionFactory etc. If I serialize the envelope directly I get:
<soapenv:Envelope>
<soapenv:Header/>
<soapenv:Body>
<GetFilteredListResponse>
<getListValues>
<Case_ID>HD0000000000002</Case_ID>
<Case_Type>Incident</Case_Type>
...
If instead I cast the envelope to MessageElement and serialize
envelope.getAsDocument(), as in:
MessageElement envelope = (MessageElement)
soapPart.getEnvelope();
DOMUtils.writeToDebug( envelope.getAsDocument() );
I get what I expect, and need:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<GetFilteredListResponse xmlns="urn:HelpDesk_Query_Service">
<getListValues>
<Case_ID>HD0000000000002</Case_ID>
<Case_Type>Incident</Case_Type>
...
One of the main benefits of SAAJ1.2 is the implementation of w3c dom.
Why is the behavior different? A bug, I hope (rather than a design
decision)?
--
Michael Hoefer
Chief Architect
Software Engineering
Niku Corporation
305 Main Street
Redwood City, CA 94063
Tel: 650.298.5916
Fax: 650.298.5946
Web: www.niku.com
CONFIDENTIALITY NOTICE: The information contained in this message and
or attachments is intended only for the person or entity to which it is
addressed and may contain confidential and/or privileged material. Any
review, retransmission, dissemination, copying, or other use of this
information by persons or entities other than the intended recipient is
prohibited. If you received this e-mail or its attachments in error,
please contact the sender and delete the material from any system and
destroy any copies.