Hi Jongjin, Yes, OM throws errors when SOAP messages violate the SOAP spec. The reason simply is that OM is meant to be a SOAP specific object model. So SOAP messages that are not qualified will throw errors :) We are thinking of extending OM as a generic XML object model but it's still in the drawing boards.
Well you are right. I have to run this XML through Om to see whether this is recreatable but just by looking at the code I understand that the variable ns (the whole namspace object) should be null. On Thu, 3 Mar 2005 19:46:14 +0900, Jongjin Choi <[EMAIL PROTECTED]> wrote: > Hi. > > The Aixom doest not seem to serialize soap message which has an unqualified > soap body element. > > For example, > <soapenv:Body> > <ns1:getBalance xmlns:ns1=http://localhost:8081/axis/services/BankPort/> > <accountNo href="#id0"/> > </ns1:getBalacne> > </soapenv:Body> > > The following exception occurs when serializing. > > org.apache.axis.om.OMException: Non namespace qualified elements are not > allowed > at > org.apache.axis.om.impl.llom.OMElementImpl.serializeStartpart(OMElementImpl.java:681) > at > org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:723) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632) > at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638) > at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127) > at > org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632) > at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:638) > at org.apache.axis.om.impl.llom.OMTextImpl.serialize(OMTextImpl.java:127) > at > org.apache.axis.om.impl.llom.OMElementImpl.serializeNormal(OMElementImpl.java:726) > at > org.apache.axis.om.impl.llom.OMElementImpl.serialize(OMElementImpl.java:632) > > But the OMElement for <accountNo> element is built and the localname and > namespace's value are set. > > For example, > > Envelope envelope = (SOAPEnvelope)builder.getDocumentElement(); > SOAPBody sb = envelope.getBody(); > OMElement e1 = sb.getFirstElement(); // <ns1:getBalance> > OMElement e2 = e1.getFirstElement(); // <accountNo> > OMNamespace ns = e2.getNamespace(); > > The values of localName and namespace of OMElment e2 are : > > e2.getLocalName() = accountNo > e2.getNamespaceName() = null; > ns.getName() = http://localhost:8081/axis/services/BankPort > ns.getPrefix() = ns1 > > The questions are: > 1. Why OMElement throws exception when serializing namespace-unqualified > element? > 2. The unqualifed element's OMElement is built but the OMNamespace for this > OMElement looks invalid. > In this case, I think the values should be : > ns.getName() = "" or null > ns.getPrefix() = "" or null > Is this right or am I miss something in OMElement? > > Thanks. > > /Jongjin > > -- Ajith Ranabahu
