[ http://issues.apache.org/jira/browse/AXIS-1807?page=comments#action_58757 ] Steve Viens commented on AXIS-1807: -----------------------------------
The 'find_business' W3C element that's being added to the SOAPBody (via addDocument) specifies this default namespace: xmlns="urn:uddi-org:api_v2" By design, child elements within 'find_business' also fall under this namespace. From: http://www.w3.org/TR/REC-xml-names/#scoping-defaulting "The namespace declaration is considered to apply to the element where it is specified and to all elements within the content of that element, unless overridden by another namespace declaration..." If Axis adds it's own xmlns="" to all child elements then these elements are no longer associated with the default namespace specified in the 'find_business' element. From: http://www.w3.org/TR/REC-xml-names/#defaulting "If the URI reference in a default namespace declaration is empty, then unprefixed elements in the scope of the declaration are not considered to be in any namespace." Steve > Empty default namespace attributes (xmlns="") appear when using: > SOAPBody.addDocument > ------------------------------------------------------------------------------------- > > Key: AXIS-1807 > URL: http://issues.apache.org/jira/browse/AXIS-1807 > Project: Axis > Type: Bug > Components: SAAJ > Versions: 1.2RC2 > Environment: J2SDK 1.4.2_04 + Axis 1.2rc2 > Reporter: Steve Viens > Attachments: FindBusiness.java > > I've discovered a bug in the "addDocument(org.w3c.dom.Document)" method of > the javax.xml.SOAPBody class. Empty default namespace attributes (xmlns="") > are added to any elements that do not specify a default namespace of their > own. > Before I submit something to JIRA I'd like to make sure that I'm not just > missing something basic. To see the problem yourself all you have to do is > create an "org.w3c.Document" that when written to System.out looks as follows: > <find_business generic="2.0" xmlns="urn:uddi-org:api_v2" > operator="Apache.org"> > <businessInfos> > <businessInfo > businessKey="4FFA64E0-71A6-11D9-A4E0-CA68EE9CC1F6"/> > </businessInfos> > </find_business> > Then add this "org.w3c.Document" to a "javax.xml.soap.SOAPBody" using the > "addDocument(org.w3c.dom.Document)" method. When this new SOAP message is > written to System.out the resulting XML looks as follows: > <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> > <find_business generic="2.0" xmlns="urn:uddi-org:api_v2" > operator="Apache.org"> > <businessInfos xmlns=""> > <businessInfo > businessKey="4FFA64E0-71A6-11D9-A4E0-CA68EE9CC1F6" xmlns=""/> > </businessInfos> > </find_business> > </soapenv:Body> > </soapenv:Envelope> > Notice the empty default namespace attributes (xmlns="") in the > "businessInfos" and "businessInfo" elements? This empty default namespace > attribute will appear for every child element of "find_business" element that > does not have an xmlns attribute already. > I will post sample code as a follow up (FindBusiness) that will demonstrate > this. I'm using Axis 1.2rc2 and I didn't see anything related to this in > JIRA already. > Steve -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
