ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1701519 - in /webservices/axiom/trunk: aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/ implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/ implementations/axiom-dom/src/main/java/org/apache/axi...
Date Sun, 06 Sep 2015 19:43:42 GMT
Author: veithen
Date: Sun Sep  6 19:43:42 2015
New Revision: 1701519

URL: http://svn.apache.org/r1701519
Log:
Introduce SOAP version specific subclasses for SOAPEnvelope.

Added:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11Envelope.java
  (with props)
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11EnvelopeSupport.aj
  (with props)
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12Envelope.java
  (with props)
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12EnvelopeSupport.aj
  (with props)
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11EnvelopeImpl.java
  (with props)
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12EnvelopeImpl.java
  (with props)
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11EnvelopeImpl.java
  (with props)
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12EnvelopeImpl.java
  (with props)
Modified:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPEnvelopeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/SOAPHelper.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java

Added: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11Envelope.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11Envelope.java?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11Envelope.java
(added)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11Envelope.java
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.common;
+
+public interface AxiomSOAP11Envelope extends AxiomSOAPEnvelope {
+
+}

Propchange: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11Envelope.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11EnvelopeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11EnvelopeSupport.aj?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11EnvelopeSupport.aj
(added)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11EnvelopeSupport.aj
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.common;
+
+import org.apache.axiom.core.CoreNode;
+import org.apache.axiom.om.OMNode;
+
+public aspect AxiomSOAP11EnvelopeSupport {
+    public final Class<? extends CoreNode> AxiomSOAP11Envelope.coreGetNodeClass() {
+        return AxiomSOAP11Envelope.class;
+    }
+    
+    public final void AxiomSOAP11Envelope.internalCheckChild(OMNode child) {
+    }
+}

Propchange: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP11EnvelopeSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12Envelope.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12Envelope.java?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12Envelope.java
(added)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12Envelope.java
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.common;
+
+public interface AxiomSOAP12Envelope extends AxiomSOAPEnvelope {
+
+}

Propchange: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12Envelope.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12EnvelopeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12EnvelopeSupport.aj?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12EnvelopeSupport.aj
(added)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12EnvelopeSupport.aj
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.common;
+
+import org.apache.axiom.core.CoreNode;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.soap.SOAP12Constants;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPProcessingException;
+
+public aspect AxiomSOAP12EnvelopeSupport {
+    public final Class<? extends CoreNode> AxiomSOAP12Envelope.coreGetNodeClass() {
+        return AxiomSOAP12Envelope.class;
+    }
+
+    public final void AxiomSOAP12Envelope.internalCheckChild(OMNode child) {
+        if ((child instanceof OMElement)
+                && !(child instanceof SOAPHeader || child instanceof SOAPBody)) {
+            throw new SOAPProcessingException(
+                    "SOAP Envelope can not have children other than SOAP Header and Body",
+                    SOAP12Constants.FAULT_CODE_SENDER);
+        }
+    }
+}

Propchange: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAP12EnvelopeSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPEnvelopeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPEnvelopeSupport.aj?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPEnvelopeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPEnvelopeSupport.aj
Sun Sep  6 19:43:42 2015
@@ -18,10 +18,14 @@
  */
 package org.apache.axiom.soap.impl.common;
 
-import org.apache.axiom.core.CoreNode;
+import org.apache.axiom.om.OMNode;
 
 public aspect AxiomSOAPEnvelopeSupport {
-    public final Class<? extends CoreNode> AxiomSOAPEnvelope.coreGetNodeClass() {
-        return AxiomSOAPEnvelope.class;
-    }
+    /**
+     * Check that a node is allowed as a child of a SOAP envelope.
+     * 
+     * @param child
+     */
+    // TODO: this should be integrated into the checkChild API
+    public abstract void AxiomSOAPEnvelope.internalCheckChild(OMNode child);
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPFactorySupport.aj
Sun Sep  6 19:43:42 2015
@@ -91,11 +91,11 @@ public aspect AxiomSOAPFactorySupport {
     }
     
     public final SOAPEnvelope AxiomSOAPFactory.createSOAPEnvelope(OMNamespace ns) {
-        return createAxiomElement(AxiomSOAPEnvelope.class, null, SOAPConstants.SOAPENVELOPE_LOCAL_NAME,
ns, null, true);
+        return createAxiomElement(getSOAPHelper().getEnvelopeClass(), null, SOAPConstants.SOAPENVELOPE_LOCAL_NAME,
ns, null, true);
     }
 
     public final SOAPEnvelope AxiomSOAPFactory.createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper
builder) {
-        return createAxiomElement(AxiomSOAPEnvelope.class, message, SOAPConstants.SOAPENVELOPE_LOCAL_NAME,
null, builder, false);
+        return createAxiomElement(getSOAPHelper().getEnvelopeClass(), message, SOAPConstants.SOAPENVELOPE_LOCAL_NAME,
null, builder, false);
     }
 
     public final SOAPHeader AxiomSOAPFactory.createSOAPHeader(SOAPEnvelope parent, OMXMLParserWrapper
builder) {

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/SOAPHelper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/SOAPHelper.java?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/SOAPHelper.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/SOAPHelper.java
Sun Sep  6 19:43:42 2015
@@ -36,6 +36,7 @@ import org.apache.axiom.soap.SOAPVersion
  */
 abstract class SOAPHelper {
     static final SOAPHelper SOAP11 = new SOAPHelper(SOAP11Version.getSingleton(), "SOAP 1.1",
+            AxiomSOAP11Envelope.class,
             AxiomSOAP11Header.class,
             AxiomSOAP11HeaderBlock.class,
             AxiomSOAP11Body.class,
@@ -62,6 +63,7 @@ abstract class SOAPHelper {
     };
     
     static final SOAPHelper SOAP12 = new SOAPHelper(SOAP12Version.getSingleton(), "SOAP 1.2",
+            AxiomSOAP12Envelope.class,
             AxiomSOAP12Header.class,
             AxiomSOAP12HeaderBlock.class,
             AxiomSOAP12Body.class,
@@ -90,6 +92,7 @@ abstract class SOAPHelper {
     private final SOAPVersion version;
     private final OMNamespace namespace;
     private final String specName;
+    private final Class<? extends AxiomSOAPEnvelope> envelopeClass;
     private final Class<? extends AxiomSOAPHeader> headerClass;
     private final QName headerQName;
     private final Class<? extends AxiomSOAPHeaderBlock> headerBlockClass;
@@ -106,6 +109,7 @@ abstract class SOAPHelper {
     private final QName relayAttributeQName;
     
     private SOAPHelper(SOAPVersion version, String specName,
+            Class<? extends AxiomSOAPEnvelope> envelopeClass,
             Class<? extends AxiomSOAPHeader> headerClass,
             Class<? extends AxiomSOAPHeaderBlock> headerBlockClass,
             Class<? extends AxiomSOAPBody> bodyClass,
@@ -119,6 +123,7 @@ abstract class SOAPHelper {
         namespace = new OMNamespaceImpl(version.getEnvelopeURI(),
                 SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
         this.specName = specName;
+        this.envelopeClass = envelopeClass;
         this.headerClass = headerClass;
         headerQName = new QName(version.getEnvelopeURI(), SOAPConstants.HEADER_LOCAL_NAME,
                 SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
@@ -157,6 +162,10 @@ abstract class SOAPHelper {
         return specName;
     }
 
+    final Class<? extends AxiomSOAPEnvelope> getEnvelopeClass() {
+        return envelopeClass;
+    }
+
     final Class<? extends AxiomSOAPHeader> getHeaderClass() {
         return headerClass;
     }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
Sun Sep  6 19:43:42 2015
@@ -75,6 +75,7 @@ import org.apache.axiom.om.impl.dom.OMSo
 import org.apache.axiom.om.impl.dom.ProcessingInstructionImpl;
 import org.apache.axiom.om.impl.dom.TextImpl;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Body;
+import org.apache.axiom.soap.impl.common.AxiomSOAP11Envelope;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Fault;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultCode;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultDetail;
@@ -83,6 +84,7 @@ import org.apache.axiom.soap.impl.common
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Header;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11HeaderBlock;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12Body;
+import org.apache.axiom.soap.impl.common.AxiomSOAP12Envelope;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12Fault;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultCode;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultDetail;
@@ -94,11 +96,10 @@ import org.apache.axiom.soap.impl.common
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultValue;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12Header;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12HeaderBlock;
-import org.apache.axiom.soap.impl.common.AxiomSOAPEnvelope;
 import org.apache.axiom.soap.impl.common.AxiomSOAPMessage;
-import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
 import org.apache.axiom.soap.impl.dom.SOAPMessageImpl;
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11BodyImpl;
+import org.apache.axiom.soap.impl.dom.soap11.SOAP11EnvelopeImpl;
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultCodeImpl;
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultDetailImpl;
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultImpl;
@@ -107,6 +108,7 @@ import org.apache.axiom.soap.impl.dom.so
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11HeaderBlockImpl;
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11HeaderImpl;
 import org.apache.axiom.soap.impl.dom.soap12.SOAP12BodyImpl;
+import org.apache.axiom.soap.impl.dom.soap12.SOAP12EnvelopeImpl;
 import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultCodeImpl;
 import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultDetailImpl;
 import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultImpl;
@@ -166,8 +168,10 @@ public class OMDOMFactory implements Axi
             node = new OMSourcedElementImpl(this);
         } else if (type == AxiomSOAPMessage.class) {
             node = new SOAPMessageImpl(this);
-        } else if (type == AxiomSOAPEnvelope.class) {
-            node = new SOAPEnvelopeImpl(this);
+        } else if (type == AxiomSOAP11Envelope.class) {
+            node = new SOAP11EnvelopeImpl(this);
+        } else if (type == AxiomSOAP12Envelope.class) {
+            node = new SOAP12EnvelopeImpl(this);
         } else if (type == AxiomSOAP11Header.class) {
             node = new SOAP11HeaderImpl(this);
         } else if (type == AxiomSOAP12Header.class) {

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPEnvelopeImpl.java
Sun Sep  6 19:43:42 2015
@@ -32,7 +32,6 @@ import org.apache.axiom.om.impl.common.s
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP11Version;
 import org.apache.axiom.soap.SOAP12Constants;
-import org.apache.axiom.soap.SOAP12Version;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPConstants;
 import org.apache.axiom.soap.SOAPFactory;
@@ -46,7 +45,7 @@ import org.w3c.dom.Node;
 
 import javax.xml.namespace.QName;
 
-public class SOAPEnvelopeImpl extends SOAPElement implements AxiomSOAPEnvelope,
+public abstract class SOAPEnvelopeImpl extends SOAPElement implements AxiomSOAPEnvelope,
         OMConstants {
 
     public SOAPEnvelopeImpl(OMFactory factory) {
@@ -72,27 +71,8 @@ public class SOAPEnvelopeImpl extends SO
         return header != null ? header : ((SOAPFactory)getOMFactory()).createSOAPHeader(this);
     }
 
-    /**
-     * Check that a node is allowed as a child of a SOAP envelope.
-     * 
-     * @param child
-     */
-    // TODO: this should be integrated into the checkChild API
-    private void internalCheckChild(OMNode child) {
-        if ((child instanceof OMElement)
-                && !(child instanceof SOAPHeader || child instanceof SOAPBody)) {
-            throw new SOAPProcessingException(
-                    "SOAP Envelope can not have children other than SOAP Header and Body",
-                    SOAP12Constants.FAULT_CODE_SENDER);
-        }
-    }
-
     public void addChild(OMNode child, boolean fromBuilder) {
-        // SOAP 1.1 allows for arbitrary elements after SOAPBody so do NOT check for
-        // node types when appending to SOAP 1.1 envelope.
-        if (getVersion() instanceof SOAP12Version) {
-            internalCheckChild(child);
-        }
+        internalCheckChild(child);
 
         if (child instanceof SOAPHeader) {
             // The SOAPHeader is added before the SOAPBody

Added: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11EnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11EnvelopeImpl.java?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11EnvelopeImpl.java
(added)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11EnvelopeImpl.java
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.dom.soap11;
+
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.soap.impl.common.AxiomSOAP11Envelope;
+import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
+
+public class SOAP11EnvelopeImpl extends SOAPEnvelopeImpl implements AxiomSOAP11Envelope {
+    public SOAP11EnvelopeImpl(OMFactory factory) {
+        super(factory);
+    }
+}

Propchange: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap11/SOAP11EnvelopeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12EnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12EnvelopeImpl.java?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12EnvelopeImpl.java
(added)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12EnvelopeImpl.java
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.dom.soap12;
+
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.soap.impl.common.AxiomSOAP12Envelope;
+import org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl;
+
+public class SOAP12EnvelopeImpl extends SOAPEnvelopeImpl implements AxiomSOAP12Envelope {
+    public SOAP12EnvelopeImpl(OMFactory factory) {
+        super(factory);
+    }
+}

Propchange: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/soap12/SOAP12EnvelopeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
Sun Sep  6 19:43:42 2015
@@ -55,6 +55,7 @@ import org.apache.axiom.om.impl.llom.OME
 import org.apache.axiom.om.impl.llom.OMProcessingInstructionImpl;
 import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Body;
+import org.apache.axiom.soap.impl.common.AxiomSOAP11Envelope;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Fault;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultCode;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultDetail;
@@ -63,6 +64,7 @@ import org.apache.axiom.soap.impl.common
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Header;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11HeaderBlock;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12Body;
+import org.apache.axiom.soap.impl.common.AxiomSOAP12Envelope;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12Fault;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultCode;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultDetail;
@@ -74,11 +76,10 @@ import org.apache.axiom.soap.impl.common
 import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultValue;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12Header;
 import org.apache.axiom.soap.impl.common.AxiomSOAP12HeaderBlock;
-import org.apache.axiom.soap.impl.common.AxiomSOAPEnvelope;
 import org.apache.axiom.soap.impl.common.AxiomSOAPMessage;
-import org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl;
 import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11BodyImpl;
+import org.apache.axiom.soap.impl.llom.soap11.SOAP11EnvelopeImpl;
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultCodeImpl;
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultDetailImpl;
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl;
@@ -87,6 +88,7 @@ import org.apache.axiom.soap.impl.llom.s
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderBlockImpl;
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderImpl;
 import org.apache.axiom.soap.impl.llom.soap12.SOAP12BodyImpl;
+import org.apache.axiom.soap.impl.llom.soap12.SOAP12EnvelopeImpl;
 import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultCodeImpl;
 import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultDetailImpl;
 import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultImpl;
@@ -143,8 +145,10 @@ public class OMLinkedListImplFactory imp
             node = new OMSourcedElementImpl(this);
         } else if (type == AxiomSOAPMessage.class) {
             node = new SOAPMessageImpl(this);
-        } else if (type == AxiomSOAPEnvelope.class) {
-            node = new SOAPEnvelopeImpl(this);
+        } else if (type == AxiomSOAP11Envelope.class) {
+            node = new SOAP11EnvelopeImpl(this);
+        } else if (type == AxiomSOAP12Envelope.class) {
+            node = new SOAP12EnvelopeImpl(this);
         } else if (type == AxiomSOAP11Header.class) {
             node = new SOAP11HeaderImpl(this);
         } else if (type == AxiomSOAP12Header.class) {

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java?rev=1701519&r1=1701518&r2=1701519&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
Sun Sep  6 19:43:42 2015
@@ -34,7 +34,6 @@ import org.apache.axiom.om.impl.common.s
 import org.apache.axiom.om.impl.common.serializer.push.Serializer;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
-import org.apache.axiom.soap.SOAP12Version;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPConstants;
 import org.apache.axiom.soap.SOAPFactory;
@@ -47,7 +46,7 @@ import org.apache.axiom.soap.impl.common
 import javax.xml.namespace.QName;
 
 /** Class SOAPEnvelopeImpl */
-public class SOAPEnvelopeImpl extends SOAPElement
+public abstract class SOAPEnvelopeImpl extends SOAPElement
         implements AxiomSOAPEnvelope, OMConstants {
     private static final Log log = LogFactory.getLog(SOAPEnvelopeImpl.class);
 
@@ -75,30 +74,11 @@ public class SOAPEnvelopeImpl extends SO
     }
 
     /**
-     * Check that a node is allowed as a child of a SOAP envelope.
-     * 
-     * @param child
-     */
-    // TODO: this should be integrated into the checkChild API
-    private void internalCheckChild(OMNode child) {
-        if ((child instanceof OMElement)
-                && !(child instanceof SOAPHeader || child instanceof SOAPBody)) {
-            throw new SOAPProcessingException(
-                    "SOAP Envelope can not have children other than SOAP Header and Body",
-                    SOAP12Constants.FAULT_CODE_SENDER);
-        }
-    }
-    
-    /**
      * Add a SOAPHeader or SOAPBody object
      * @param child an OMNode to add - must be either a SOAPHeader or a SOAPBody
      */
     public void addChild(OMNode child, boolean fromBuilder) {
-        // SOAP 1.1 allows for arbitrary elements after SOAPBody so do NOT check for
-        // node types when appending to SOAP 1.1 envelope.
-        if (getVersion() instanceof SOAP12Version) {
-            internalCheckChild(child);
-        }
+        internalCheckChild(child);
 
         if (child instanceof SOAPHeader) {
             // The SOAPHeader is added before the SOAPBody

Added: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11EnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11EnvelopeImpl.java?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11EnvelopeImpl.java
(added)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11EnvelopeImpl.java
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.llom.soap11;
+
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.soap.impl.common.AxiomSOAP11Envelope;
+import org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl;
+
+public class SOAP11EnvelopeImpl extends SOAPEnvelopeImpl implements AxiomSOAP11Envelope {
+    public SOAP11EnvelopeImpl(OMFactory factory) {
+        super(factory);
+    }
+}

Propchange: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11EnvelopeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12EnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12EnvelopeImpl.java?rev=1701519&view=auto
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12EnvelopeImpl.java
(added)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12EnvelopeImpl.java
Sun Sep  6 19:43:42 2015
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.soap.impl.llom.soap12;
+
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.soap.impl.common.AxiomSOAP12Envelope;
+import org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl;
+
+public class SOAP12EnvelopeImpl extends SOAPEnvelopeImpl implements AxiomSOAP12Envelope {
+    public SOAP12EnvelopeImpl(OMFactory factory) {
+        super(factory);
+    }
+}

Propchange: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12EnvelopeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message