diff --git a/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java b/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java index 6c2da8f2..ca4c70b8 100644 --- a/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java +++ b/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajContentHandler.java @@ -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();) { diff --git a/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java b/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java index 9d384ac0..1c410b3a 100644 --- a/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java +++ b/core/src/main/java/org/springframework/ws/soap/saaj/support/SaajXmlReader.java @@ -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); }