Hey all:
I got the following exception when receiving a SOAP response:
org.apache.axis2.AxisFault: Namespace URI may not be null
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at vivisimo.Stub.fromOM(Stub.java:46095)
at vivisimo.Stub.Simple(Stub.java:194)
at Main.main(Main.java:75)
Caused by: java.lang.IllegalArgumentException: Namespace URI may not be null
at
org.apache.axiom.om.impl.dom.NamespaceImpl.<init>(NamespaceImpl.java:32)
at
org.apache.axiom.om.impl.dom.NamespaceImpl.<init>(NamespaceImpl.java:38)
at vivisimo.Stub$Document_type0$Factory.parse(Stub.java:40060)
at vivisimo.Stub$List_type0$Factory.parse(Stub.java:23215)
at vivisimo.Stub$Vce$Factory.parse(Stub.java:2113)
at vivisimo.Stub.fromOM(Stub.java:46089)
Looking at the code, it comes from this section:
// now run through all any or extra attributes
// which were not reflected until now
for (int i=0; i < reader.getAttributeCount(); i++) {
if (!handledAttributes.contains(reader.getAttributeLocalName(i))) {
// this is an anyAttribute and we create
// an OMAttribute for this
org.apache.axiom.om.impl.llom.OMAttributeImpl attr =
new org.apache.axiom.om.impl.llom.OMAttributeImpl(
reader.getAttributeLocalName(i),
new org.apache.axiom.om.impl.dom.NamespaceImpl(
reader.getAttributeNamespace(i), reader.getAttributePrefix(i)),
reader.getAttributeValue(i),
org.apache.axiom.om.OMAbstractFactory.getOMFactory());
The node that is causing the failure is:
<vce xmlns="urn:/vivisimo/velocity">
<list path="" num="118" level="0" start="0" per="10">
<document
url="http://blogs.usatoday.com/popcandy/2008/07/pop-forum-tal-2.html"
rank="0" source="USAToday" score="0.111111"
context="v%3astate=%28root%29%7croot&v%3aframe=tree&subquery=id%3aNdoc1.30&active%3d=root&v%3asubsearch=1&"
/>
</list>
</vce>
The problematic attribute is @context, which is not defined in my XSD.
In all, I think there are 2 problems:
1/ I don't actually have an anyAttribute in my schema, so I would have
expected to see an error similar to the "unexpected subelement" error.
2/ I don't think that this should cause my program to generate an
exception in this manner. According to the spec:
"The namespace name for an unprefixed attribute name always has no
value." [1]
To me, this says that it is quite possible / likely for an attribute to
have a null URI. However, I would love for clarifications on this point.
For what it is worth, other attributes that *are* in my XSD seem to work
fine.
Thanks!
-Jake
http://www.w3.org/TR/xml-names/#defaulting
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]