SAAJ 1.1 now also works with Weblogic 9
This commit is contained in:
@@ -25,6 +25,7 @@ import javax.xml.soap.SOAPException;
|
||||
|
||||
import org.springframework.core.CollectionFactory;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.Locator;
|
||||
@@ -78,10 +79,12 @@ public class SaajContentHandler implements ContentHandler {
|
||||
String childPrefix = getPrefix(qName);
|
||||
SOAPElement child = element.addChildElement(localName, childPrefix, uri);
|
||||
for (int i = 0; i < atts.getLength(); i++) {
|
||||
String attributePrefix = getPrefix(atts.getQName(i));
|
||||
if (!"xmlns".equals(atts.getLocalName(i))) {
|
||||
Name attributeName = envelope.createName(atts.getLocalName(i), attributePrefix, atts.getURI(i));
|
||||
child.addAttribute(attributeName, atts.getValue(i));
|
||||
if (StringUtils.hasLength(atts.getLocalName(i))) {
|
||||
String attributePrefix = getPrefix(atts.getQName(i));
|
||||
if (!"xmlns".equals(atts.getLocalName(i))) {
|
||||
Name attributeName = envelope.createName(atts.getLocalName(i), attributePrefix, atts.getURI(i));
|
||||
child.addAttribute(attributeName, atts.getValue(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Iterator iterator = namespaces.keySet().iterator(); iterator.hasNext();) {
|
||||
|
||||
@@ -94,7 +94,7 @@ public class SaajXmlReader extends AbstractXmlReader {
|
||||
}
|
||||
|
||||
private void handleText(Text text) throws SAXException {
|
||||
if (!text.isComment() && getContentHandler() != null) {
|
||||
if (getContentHandler() != null) {
|
||||
char[] ch = text.getValue().toCharArray();
|
||||
getContentHandler().characters(ch, 0, ch.length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user