This content has been marked as final.
Show 3 replies
-
1. Re: 16:22:50,265 ERROR [SOAPElementAxisImpl] Cannot convert
danoakland May 12, 2005 1:25 PM (in response to avrahamr)I ran into this same problem -- it occurs when parsing a SOAP response and there is an attribute with a URI. The JBoss code that causes the exception is in the org.jboss.axis.message.SOAPElementAxisImpl at line 724. The 4.0.2 source code I downloaded shows this (starting with line 712):
if (uri != null && uri.trim().length() > 0) { // filterring out the tricky method to differentiate the null namespace // -ware case if (uri.equals("intentionalNullURI")) { uri = null; } if (qname.startsWith("xmlns:") == false && qname.startsWith("xsi:") == false) qname = "xmlns:" + qname; Attr attr = doc.createAttributeNS(uri, qname); attr.setValue(value); domAttributes.setNamedItemNS(attr); }
What happens is that any attribute with a URI, say for example, "POS:lineTotal" ends up being passed to the Document.createAttributeNS method as "xmlns:POS:lineTotal". It seems to be a bug. If I can find some time to create a test case, I'll submit it to JIRA.
By the way, commenting out lines 721 and 722 (where qname is set to "xmlns:" + qname) seems to correct the problem for me, but I'm not sure what consequences that would have in other cases.
Dan -
2. Re: 16:22:50,265 ERROR [SOAPElementAxisImpl] Cannot convert
avrahamr May 15, 2005 4:19 AM (in response to avrahamr)I found a way to make it work on 4.0.2. I didn't test it back to 4.0.1:
SOAPMessageContext soapContext = (SOAPMessageContext) messageContext; SOAPMessage soapMsg = soapContext.getMessage(); Source source = soapMsg.getSOAPPart().getContent(); StringWriter writer = new StringWriter(); Result result = new StreamResult(writer); Transformer xformer = TransformerFactory.newInstance().newTransformer(); xformer.transform(source, result); return writer.toString();
-
3. Re: 16:22:50,265 ERROR [SOAPElementAxisImpl] Cannot convert
thomas.diesler May 17, 2005 6:40 AM (in response to avrahamr)This has been assigned to
http://jira.jboss.com/jira/browse/JBWS-223