Author: thomas.diesler(a)jboss.com
Date: 2007-04-10 11:53:26 -0400 (Tue, 10 Apr 2007)
New Revision: 2782
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
Log:
Layout code
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-04-10
15:46:40 UTC (rev 2781)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-04-10
15:53:26 UTC (rev 2782)
@@ -36,6 +36,7 @@
import javax.xml.soap.Text;
import org.jboss.logging.Logger;
+import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -207,20 +208,14 @@
return super.replaceChild(newChild, oldChild);
}
- private static boolean needsConversionToBodyElement(Node node)
+ @Override
+ public SOAPElement addAttribute(Name name, String value) throws SOAPException
{
- // JBCTS-440 #addTextNodeTest1 appends a Text node to a SOAPBody
- return !(node instanceof SOAPBodyElement || node instanceof DocumentFragment ||
node instanceof Text);
- }
+ String envNamespace = getNamespaceURI();
+ if (Constants.NS_SOAP12_ENV.equals(envNamespace) && name.equals(new
NameImpl("encodingStyle", Constants.PREFIX_ENV, envNamespace)))
+ throw new SOAPException("Cannot set encodingStyle on: " +
getElementQName());
- private static SOAPBodyElementDoc convertToBodyElement(Node node)
- {
- if (!(node instanceof SOAPElementImpl))
- throw new IllegalArgumentException("SOAPElement expected");
-
- SOAPElementImpl element = (SOAPElementImpl)node;
- element.detachNode();
- return new SOAPBodyElementDoc(element);
+ return super.addAttribute(name, value);
}
public Document extractContentAsDocument() throws SOAPException
@@ -258,4 +253,20 @@
return newDocument;
}
+
+ private static boolean needsConversionToBodyElement(Node node)
+ {
+ // JBCTS-440 #addTextNodeTest1 appends a Text node to a SOAPBody
+ return !(node instanceof SOAPBodyElement || node instanceof DocumentFragment ||
node instanceof Text);
+ }
+
+ private static SOAPBodyElementDoc convertToBodyElement(Node node)
+ {
+ if (!(node instanceof SOAPElementImpl))
+ throw new IllegalArgumentException("SOAPElement expected");
+
+ SOAPElementImpl element = (SOAPElementImpl)node;
+ element.detachNode();
+ return new SOAPBodyElementDoc(element);
+ }
}
Show replies by date