You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2005/04/19 06:42:55 UTC

svn commit: r161838 - in webservices/axis/trunk/java/modules: core/src/org/apache/axis/engine/ samples/test/org/apache/axis/om/builder/ tool/src/org/apache/axis/tool/core/ xml/src/org/apache/axis/om/ xml/src/org/apache/axis/om/impl/llom/ xml/src/org/apache/axis/om/impl/llom/builder/ xml/src/org/apache/axis/om/impl/llom/factory/ xml/test/org/apache/axis/om/ xml/test/org/apache/axis/om/factory/ xml/test/org/apache/axis/om/impl/serializer/

Author: chinthaka
Date: Mon Apr 18 21:42:52 2005
New Revision: 161838

URL: http://svn.apache.org/viewcvs?view=rev&rev=161838
Log:
Adding SOAP specific stuff

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfiguration.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfigurationImpl.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis/om/builder/ObjectToOMBuilderTest.java
    webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/FileCopier.java
    webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/JarFileWriter.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMConstants.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPBodyImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPFaultImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/OMChildrenQNameIteratorTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/factory/OMLinkedListImplFactoryTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/impl/serializer/ElementSerializerTest.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfiguration.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfiguration.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfiguration.java Mon Apr 18 21:42:52 2005
@@ -134,4 +134,5 @@
     public HashMap getTransportsIn();
     public HashMap getTransportsOut();
 
+    ArrayList getFaultPhases();
 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfigurationImpl.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfigurationImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/EngineConfigurationImpl.java Mon Apr 18 21:42:52 2005
@@ -196,6 +196,10 @@
         return transportsOut;
     }
 
+    public ArrayList getFaultPhases() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
     /**
      * Method getTransports
      *

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/om/builder/ObjectToOMBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/om/builder/ObjectToOMBuilderTest.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/om/builder/ObjectToOMBuilderTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/om/builder/ObjectToOMBuilderTest.java Mon Apr 18 21:42:52 2005
@@ -22,6 +22,8 @@
 import org.apache.axis.om.OMFactory;
 import org.apache.axis.om.OMNamespace;
 import org.apache.axis.om.OMNode;
+import org.apache.axis.om.impl.llom.SOAPConstants;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis.om.builder.dummy.DummyOutObject;
 import org.apache.axis.testUtils.Encoder;
 import org.apache.axis.testUtils.ObjectToOMBuilder;
@@ -45,7 +47,7 @@
         super.setUp();
         Encoder outObject = new DummyOutObject();
         OMFactory omFactory = OMFactory.newInstance();
-        OMNamespace ns = omFactory.createOMNamespace(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX);
+        OMNamespace ns = omFactory.createOMNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
         element = omFactory.createOMElement("Body", ns);
         new ObjectToOMBuilder(element, outObject);
         tempFile = File.createTempFile("temp", "xml");

Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/FileCopier.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/FileCopier.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/FileCopier.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/FileCopier.java Mon Apr 18 21:42:52 2005
@@ -30,7 +30,7 @@
         this.getProject().init();
         this.setTaskType("copy");
         this.setTaskName("copy-files");
-        this.setOwningTarget(new Target());
+        this.setOwningTarget(new org.apache.tools.ant.Target());
     }
 
     public void copyFiles(File sourceFile,File destinationDirectory){

Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/JarFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/JarFileWriter.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/JarFileWriter.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/core/JarFileWriter.java Mon Apr 18 21:42:52 2005
@@ -31,7 +31,7 @@
         this.getProject().init();
         this.setTaskType("jar");
         this.setTaskName("jar");
-        this.setOwningTarget(new Target());
+        this.setOwningTarget(new org.apache.tools.ant.Target());
     }
 
     public void writeJarFile(File outputFolder,String outputFileName,File inputFileFolder) throws IOException,Exception {

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMConstants.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMConstants.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMConstants.java Mon Apr 18 21:42:52 2005
@@ -19,110 +19,8 @@
  * Interface OMConstants
  */
 public interface OMConstants {
-    /**
-     * Field SOAP_ENVELOPE_NAMESPACE_URI
-     */
-    public static final String SOAP_ENVELOPE_NAMESPACE_URI =
-            "http://schemas.xmlsoap.org/soap/envelope/";
-
-    /**
-     * Field SOAPENVELOPE_NAMESPACE_PREFIX
-     */
-    public static final String SOAPENVELOPE_NAMESPACE_PREFIX = "soapenv";
-
-    /**
-     * Field SOAPENVELOPE_LOCAL_NAME
-     */
-    public static final String SOAPENVELOPE_LOCAL_NAME = "Envelope";
-
-    // Header constants
-    /**
-     * Field HEADER_NAMESPACEURI
-     */
-    public static final String HEADER_NAMESPACEURI =
-            SOAP_ENVELOPE_NAMESPACE_URI;
-
-    /**
-     * Field HEADER_LOCAL_NAME
-     */
-    public static final String HEADER_LOCAL_NAME = "Header";
-
-    /**
-     * Field HEADER_NAMESPACE_PREFIX
-     */
-    public static final String HEADER_NAMESPACE_PREFIX =
-            SOAPENVELOPE_NAMESPACE_PREFIX;
-
-    // Body Constants
-    /**
-     * Field BODY_NAMESPACE_URI
-     */
-    public static final String BODY_NAMESPACE_URI = SOAP_ENVELOPE_NAMESPACE_URI;
-
-    /**
-     * Field BODY_LOCAL_NAME
-     */
-    public static final String BODY_LOCAL_NAME = "Body";
-
-    /**
-     * Field BODY_NAMESPACE_PREFIX
-     */
-    public static final String BODY_NAMESPACE_PREFIX =
-            SOAPENVELOPE_NAMESPACE_PREFIX;
-
-    /**
-     * Field BODY_FAULT_LOCAL_NAME
-     */
-    public static final String BODY_FAULT_LOCAL_NAME = "Fault";
-
-    // Attribute names of a SOAP Envelope
-    /**
-     * Field ATTR_ACTOR
-     */
-    public static final String ATTR_ACTOR = "actor";
-
-    /**
-     * Field ATTR_MUSTUNDERSTAND
-     */
-    public static final String ATTR_MUSTUNDERSTAND = "mustUnderstand";
-
-    /**
-     * Field SOAPFAULT_LOCAL_NAME
-     */
-    public static final String SOAPFAULT_LOCAL_NAME = "Fault";
-
-    /**
-     * Field SOAPFAULT_CODE_LOCAL_NAME
-     */
-    public static final String SOAPFAULT_CODE_LOCAL_NAME = "faultcode";
-
-    /**
-     * Field SOAPFAULT_STRING_LOCAL_NAME
-     */
-    public static final String SOAPFAULT_STRING_LOCAL_NAME = "faultstring";
-
-    /**
-     * Field SOAPFAULT_ACTOR_LOCAL_NAME
-     */
-    public static final String SOAPFAULT_ACTOR_LOCAL_NAME = "faultactor";
-
-    /**
-     * Field SOAPFAULT_DETAIL_LOCAL_NAME
-     */
-    public static final String SOAPFAULT_DETAIL_LOCAL_NAME = "detail";
-
-    /**
-     * Field SOAPFAULT_NAMESPACE_URI
-     */
-    public static final String SOAPFAULT_NAMESPACE_URI =
-            SOAP_ENVELOPE_NAMESPACE_URI;
-
-    /**
-     * Field SOAPFAULT_NAMESPACE_PREFIX
-     */
-    public static final String SOAPFAULT_NAMESPACE_PREFIX =
-            SOAPENVELOPE_NAMESPACE_PREFIX;
 
+       
     // OMBuilder constants
     /**
      * Field PUSH_TYPE_BUILDER

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPBodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPBodyImpl.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPBodyImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPBodyImpl.java Mon Apr 18 21:42:52 2005
@@ -22,6 +22,7 @@
 import org.apache.axis.om.SOAPBody;
 import org.apache.axis.om.SOAPEnvelope;
 import org.apache.axis.om.SOAPFault;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 
 /**
  * Class SOAPBodyImpl
@@ -39,7 +40,7 @@
     public SOAPBodyImpl(SOAPEnvelope envelope) {
         super(envelope);
         this.ns = envelope.getNamespace();
-        this.localName = OMConstants.BODY_LOCAL_NAME;
+        this.localName = SOAPConstants.BODY_LOCAL_NAME;
     }
 
     /**
@@ -49,7 +50,7 @@
      * @param builder
      */
     public SOAPBodyImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
-        super(OMConstants.BODY_LOCAL_NAME, envelope.getNamespace(), envelope,
+        super(SOAPConstants.BODY_LOCAL_NAME, envelope.getNamespace(), envelope,
                 builder);
     }
 
@@ -82,8 +83,8 @@
         } else {
             OMElement element = getFirstElement();
             if(element != null 
-                && SOAPFAULT_LOCAL_NAME.equals(element.getLocalName()) 
-                && SOAPFAULT_NAMESPACE_URI.equals(element.getNamespaceName())){
+                && SOAPConstants.SOAPFAULT_LOCAL_NAME.equals(element.getLocalName())
+                && SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(element.getNamespaceName())){
                 hasSOAPFault = true;
                 return true;
             }else{
@@ -103,8 +104,8 @@
         if(hasSOAPFault){
             OMElement element = getFirstElement();
             if(element != null 
-                && SOAPFAULT_LOCAL_NAME.equals(element.getLocalName()) 
-                && SOAPFAULT_NAMESPACE_URI.equals(element.getNamespaceName())){
+                && SOAPConstants.SOAPFAULT_LOCAL_NAME.equals(element.getLocalName())
+                && SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(element.getNamespaceName())){
                 hasSOAPFault = true;
                 return (SOAPFault)element;
             }else{

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPEnvelopeImpl.java Mon Apr 18 21:42:52 2005
@@ -33,7 +33,7 @@
      * @param builder
      */
     public SOAPEnvelopeImpl(OMXMLParserWrapper builder) {
-        super(SOAPENVELOPE_LOCAL_NAME, null, null, builder);
+        super(SOAPConstants.SOAPENVELOPE_LOCAL_NAME, null, null, builder);
     }
 
     /**
@@ -43,14 +43,14 @@
      * @param builder
      */
     public SOAPEnvelopeImpl(OMNamespace ns, OMXMLParserWrapper builder) {
-        super(SOAPENVELOPE_LOCAL_NAME, ns, null, builder);
+        super(SOAPConstants.SOAPENVELOPE_LOCAL_NAME, ns, null, builder);
     }
 
     /**
      * @param ns
      */
     public SOAPEnvelopeImpl(OMNamespace ns) {
-        super(SOAPENVELOPE_LOCAL_NAME, ns);
+        super(SOAPConstants.SOAPENVELOPE_LOCAL_NAME, ns);
     }
 
     /**
@@ -68,7 +68,7 @@
      */
     public SOAPHeader getHeader() throws OMException {
         OMElement element = getFirstElement();
-        if (OMConstants.HEADER_LOCAL_NAME.equals(element.getLocalName())) {
+        if (SOAPConstants.HEADER_LOCAL_NAME.equals(element.getLocalName())) {
             return (SOAPHeader) element;
         }
         return null;
@@ -90,11 +90,11 @@
      */
     public SOAPBody getBody() throws OMException {
         OMElement element = getFirstElement();
-        if (OMConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
+        if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
             return (SOAPBody) element;
         }else{
             element = element.getNextSiblingElement();
-            if (OMConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
+            if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
                 return (SOAPBody) element;
             }
         }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPFaultImpl.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPFaultImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPFaultImpl.java Mon Apr 18 21:42:52 2005
@@ -24,6 +24,7 @@
 import org.apache.axis.om.OMText;
 import org.apache.axis.om.OMXMLParserWrapper;
 import org.apache.axis.om.SOAPFault;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLOutputFactory;
@@ -70,9 +71,9 @@
      * @param e
      */
     public SOAPFaultImpl(OMElement parent, Exception e) {
-        super(SOAPFAULT_LOCAL_NAME,
-                new OMNamespaceImpl(SOAPFAULT_NAMESPACE_URI,
-                        SOAPFAULT_NAMESPACE_PREFIX));
+        super(SOAPConstants.SOAPFAULT_LOCAL_NAME,
+                new OMNamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                        SOAPConstants.SOAPFAULT_NAMESPACE_PREFIX));
         this.parent = (OMElementImpl) parent;
         this.e = e;
         StringWriter sw = new StringWriter();
@@ -89,7 +90,7 @@
      */
     public SOAPFaultImpl(OMNamespace ns, OMElement parent,
                          OMXMLParserWrapper builder) {
-        super(SOAPFAULT_LOCAL_NAME, ns, parent, builder);
+        super(SOAPConstants.SOAPFAULT_LOCAL_NAME, ns, parent, builder);
     }
 
     /**
@@ -103,7 +104,7 @@
             faultCodeElement.detach();
         }
         faultCodeElement =
-        new OMElementImpl(OMConstants.SOAPFAULT_CODE_LOCAL_NAME, this.ns);
+        new OMElementImpl(SOAPConstants.SOAPFAULT_CODE_LOCAL_NAME, this.ns);
         this.addChild(faultCodeElement);
         faultCodeElement.addChild(new OMTextImpl(faultCodeElement,
                         faultCode.getPrefix() + ':'
@@ -129,7 +130,7 @@
         } else {
             faultCodeElement = (OMElementImpl) this.getChildWithName(
                     new QName(
-                            this.ns.getName(), OMConstants.SOAPFAULT_CODE_LOCAL_NAME,
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_CODE_LOCAL_NAME,
                             this.ns.getPrefix()));
             if (faultCodeElement != null) {
                 return this.getFaultCode();
@@ -149,7 +150,7 @@
             faultActorElement.detach();
         }
         faultActorElement =
-        new OMElementImpl(OMConstants.SOAPFAULT_ACTOR_LOCAL_NAME, this.ns);
+        new OMElementImpl(SOAPConstants.SOAPFAULT_ACTOR_LOCAL_NAME, this.ns);
         this.addChild(faultActorElement);
         faultActorElement.addChild(new OMTextImpl(faultActorElement,
                         faultActor));
@@ -173,7 +174,7 @@
         } else {
             faultActorElement = (OMElementImpl) this.getChildWithName(
                     new QName(
-                            this.ns.getName(), OMConstants.SOAPFAULT_ACTOR_LOCAL_NAME,
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_ACTOR_LOCAL_NAME,
                             this.ns.getPrefix()));
             if (faultActorElement != null) {
                 return this.getFaultString();
@@ -193,7 +194,7 @@
             faultStringElement.detach();
         }
         faultStringElement =
-        new OMElementImpl(OMConstants.SOAPFAULT_STRING_LOCAL_NAME, this.ns);
+        new OMElementImpl(SOAPConstants.SOAPFAULT_STRING_LOCAL_NAME, this.ns);
         this.addChild(faultStringElement);
         faultStringElement.addChild(new OMTextImpl(faultStringElement,
                         faultString));
@@ -217,7 +218,7 @@
         } else {
             faultStringElement = (OMElementImpl) this.getChildWithName(
                     new QName(
-                            this.ns.getName(), OMConstants.SOAPFAULT_STRING_LOCAL_NAME,
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_STRING_LOCAL_NAME,
                             this.ns.getPrefix()));
             if (faultStringElement != null) {
                 return this.getFaultString();
@@ -236,7 +237,7 @@
             detailElement.detach();
         }
         detailElement =
-        new OMElementImpl(OMConstants.SOAPFAULT_DETAIL_LOCAL_NAME, this.ns);
+        new OMElementImpl(SOAPConstants.SOAPFAULT_DETAIL_LOCAL_NAME, this.ns);
         this.addChild(detailElement);
         detailElement.addChild(detailInformation);
     }
@@ -259,7 +260,7 @@
         } else {
             detailElement = (OMElementImpl) this.getChildWithName(
                     new QName(
-                            this.ns.getName(), OMConstants.SOAPFAULT_DETAIL_LOCAL_NAME,
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_DETAIL_LOCAL_NAME,
                             this.ns.getPrefix()));
             if (detailElement != null) {
                 return detailElement;

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderBlockImpl.java Mon Apr 18 21:42:52 2005
@@ -21,6 +21,7 @@
 import org.apache.axis.om.OMNamespace;
 import org.apache.axis.om.OMXMLParserWrapper;
 import org.apache.axis.om.SOAPHeaderBlock;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 
 import javax.xml.namespace.QName;
 
@@ -63,7 +64,7 @@
      * @see #getActor() getActor()
      */
     public void setActor(String actorURI) {
-        setAttribute(OMConstants.ATTR_ACTOR, actorURI);
+        setAttribute(SOAPConstants.ATTR_ACTOR, actorURI);
     }
 
     /**
@@ -72,15 +73,15 @@
      */
     private void setAttribute(String attributeName, String attrValue) {
         OMAttribute omAttribute = this.getAttributeWithQName(
-                new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, attributeName));
+                new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, attributeName));
         if (omAttribute != null) {
             omAttribute.setValue(attrValue);
         } else {
             OMAttribute attribute = new OMAttributeImpl(
                     attributeName,
                     new OMNamespaceImpl(
-                            OMConstants.SOAP_ENVELOPE_NAMESPACE_URI,
-                            OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX), attrValue);
+                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                            SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX), attrValue);
             this.insertAttribute(attribute);
         }
     }
@@ -94,7 +95,7 @@
      * @see #setActor(String) setActor(java.lang.String)
      */
     public String getActor() {
-        return getAttribute(OMConstants.ATTR_ACTOR);
+        return getAttribute(SOAPConstants.ATTR_ACTOR);
     }
 
     /**
@@ -105,7 +106,7 @@
      */
     private String getAttribute(String attrName) {
         OMAttribute omAttribute = this.getAttributeWithQName(
-                new QName(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, attrName));
+                new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, attrName));
         return (omAttribute != null)
                 ? omAttribute.getValue()
                 : null;
@@ -128,7 +129,7 @@
      * @see #getMustUnderstand() getMustUnderstand()
      */
     public void setMustUnderstand(boolean mustUnderstand) {
-        setAttribute(OMConstants.ATTR_MUSTUNDERSTAND, mustUnderstand
+        setAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, mustUnderstand
                         ? "true"
                         : "false");
     }
@@ -143,7 +144,7 @@
      */
     public boolean getMustUnderstand() {
         String mustUnderstand = "";
-        if ((mustUnderstand = getAttribute(OMConstants.ATTR_MUSTUNDERSTAND))
+        if ((mustUnderstand = getAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND))
                 != null) {
             return mustUnderstand.equalsIgnoreCase("true");
         }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/SOAPHeaderImpl.java Mon Apr 18 21:42:52 2005
@@ -23,6 +23,7 @@
 import org.apache.axis.om.SOAPHeader;
 import org.apache.axis.om.SOAPHeaderBlock;
 import org.apache.axis.om.impl.llom.traverse.OMChildrenWithSpecificAttributeIterator;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 
 import javax.xml.namespace.QName;
 import java.util.Iterator;
@@ -39,7 +40,7 @@
 
         // set the namespaces
         this.ns = envelope.getNamespace();
-        this.localName = OMConstants.HEADER_LOCAL_NAME;
+        this.localName = SOAPConstants.HEADER_LOCAL_NAME;
     }
 
     /**
@@ -49,7 +50,7 @@
      * @param builder
      */
     public SOAPHeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
-        super(OMConstants.HEADER_LOCAL_NAME, (envelope == null)
+        super(SOAPConstants.HEADER_LOCAL_NAME, (envelope == null)
                         ? null
                         : envelope.getNamespace(), envelope,
                 builder);
@@ -132,7 +133,7 @@
         return new OMChildrenWithSpecificAttributeIterator(
                 getFirstChild(),
                 new QName(
-                        OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.ATTR_ACTOR),
+                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAPConstants.ATTR_ACTOR),
                 actor, true);
     }
 
@@ -152,7 +153,7 @@
         return new OMChildrenWithSpecificAttributeIterator(
                 getFirstChild(),
                 new QName(
-                        OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.ATTR_ACTOR),
+                        SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAPConstants.ATTR_ACTOR),
                 actor, false);
     }
 

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXSOAPModelBuilder.java Mon Apr 18 21:42:52 2005
@@ -17,8 +17,11 @@
 
 import org.apache.axis.om.*;
 import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.om.impl.llom.SOAPConstants;
 import org.apache.axis.om.impl.llom.SOAPEnvelopeImpl;
 import org.apache.axis.om.impl.llom.exception.OMBuilderException;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis.om.impl.llom.soap12.SOAP12Constants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -33,6 +36,7 @@
      * Field envelope
      */
     private SOAPEnvelopeImpl envelope;
+    private OMNamespace envelopeNamespace;
 
     /**
      * Field headerPresent
@@ -64,6 +68,42 @@
     public StAXSOAPModelBuilder(OMFactory ombuilderFactory,
                                 XMLStreamReader parser) {
         super(ombuilderFactory, parser);
+        identifySOAPVersion();
+        parseHeaders();
+    }
+
+    private void identifySOAPVersion() {
+        SOAPEnvelope soapEnvelope = getSOAPEnvelope();
+        if(soapEnvelope == null){
+            throw new OMException("No SOAPHeader present !!");
+        }
+
+        envelopeNamespace = soapEnvelope.findDeclaredNamespace(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
+        if (envelopeNamespace == null) {
+            envelopeNamespace = getSOAPEnvelope().findDeclaredNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
+        } else {
+            log.info("SOAP 1.2 message received ..");
+        }
+
+        if (envelopeNamespace == null) {
+            throw new OMException("Invalid SOAP message. Doesn't have proper namespace declaration !!");
+        } else {
+            log.info("SOAP 1.1 message received ..");
+        }
+    }
+
+    private void parseHeaders() {
+       // by the time execution comes here the nullity of SOAPEnvelope has been cheched in the
+        // identifySOAPVersion() method. So not checking getSOAPEnvelope() == null here
+        SOAPHeader soapHeader = getSOAPEnvelope().getHeader();
+
+        if (soapHeader != null) {
+            while (!soapHeader.isComplete()) {
+                next();
+            }
+        }else{
+            log.info("No SOAPHeaders present !!");
+        }
     }
 
     /**
@@ -72,7 +112,7 @@
      * @param parser
      */
     public StAXSOAPModelBuilder(XMLStreamReader parser) {
-        super(parser);
+        this(OMFactory.newInstance(), parser);
     }
 
     /**
@@ -128,9 +168,9 @@
                                     boolean isEnvelope) {
         OMElement element = null;
         if (parent == null) {
-            if (!elementName.equalsIgnoreCase(OMConstants.SOAPENVELOPE_LOCAL_NAME)) {
+            if (!elementName.equalsIgnoreCase(SOAPConstants.SOAPENVELOPE_LOCAL_NAME)) {
                 throw new OMException("First Element must contain the local name, "
-                        + OMConstants.SOAPENVELOPE_LOCAL_NAME);
+                        + SOAPConstants.SOAPENVELOPE_LOCAL_NAME);
             }
             envelope =
                     (SOAPEnvelopeImpl) ombuilderFactory.createSOAPEnvelope(null,
@@ -140,7 +180,7 @@
         } else if (elementLevel == 2) {
 
             // this is either a header or a body
-            if (elementName.equals(OMConstants.HEADER_LOCAL_NAME)) {
+            if (elementName.equals(SOAPConstants.HEADER_LOCAL_NAME)) {
                 if (headerPresent) {
                     throw new OMBuilderException("Multiple headers encountered!");
                 }
@@ -154,7 +194,7 @@
 
                 // envelope.setHeader((SOAPHeader)element);
                 processNamespaceData(element, true);
-            } else if (elementName.equals(OMConstants.BODY_LOCAL_NAME)) {
+            } else if (elementName.equals(SOAPConstants.BODY_LOCAL_NAME)) {
                 if (bodyPresent) {
                     throw new OMBuilderException("Multiple body elements encountered");
                 }
@@ -170,13 +210,13 @@
                         + " is not supported here. Envelope can not have elements other than Header and Body.");
             }
         } else if ((elementLevel == 3)
-                && parent.getLocalName().equalsIgnoreCase(OMConstants.HEADER_LOCAL_NAME)) {
+                && parent.getLocalName().equalsIgnoreCase(SOAPConstants.HEADER_LOCAL_NAME)) {
 
             // this is a headerblock
             element = ombuilderFactory.createSOAPHeaderBlock(elementName, null,
                     parent, this);
             processNamespaceData(element, false);
-        } else if ((elementLevel == 3) && parent.getLocalName().equalsIgnoreCase(OMConstants.BODY_LOCAL_NAME) && elementName.equalsIgnoreCase(OMConstants.BODY_FAULT_LOCAL_NAME)) {
+        } else if ((elementLevel == 3) && parent.getLocalName().equalsIgnoreCase(SOAPConstants.BODY_LOCAL_NAME) && elementName.equalsIgnoreCase(SOAPConstants.BODY_FAULT_LOCAL_NAME)) {
 
             // this is a headerblock
             element = ombuilderFactory.createSOAPFault(null, (SOAPBody) parent,
@@ -210,12 +250,15 @@
             switch (token) {
                 case XMLStreamConstants.START_ELEMENT:
                     elementLevel++;
+                    System.out.println("Start ==> "+parser.getLocalName());
                     lastNode = createOMElement();
                     break;
                 case XMLStreamConstants.CHARACTERS:
                     lastNode = createOMText();
                     break;
                 case XMLStreamConstants.END_ELEMENT:
+                    System.out.println("End ==> "+parser.getLocalName());
+
                     if (lastNode.isComplete()) {
                         OMElement parent = lastNode.getParent();
                         parent.setComplete(true);
@@ -292,10 +335,14 @@
         // throw new OMException("All elements must be namespace qualified!");
         // }
         if (isSOAPElement) {
-            if (node.getNamespace() != null && !node.getNamespace().getName().equals(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI)) {
+            if (node.getNamespace() != null && !node.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI) && !node.getNamespace().getName().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                 throw new OMBuilderException("invalid SOAP namespace URI");
             }
         }
 
+    }
+
+    public OMNamespace getEnvelopeNamespace() {
+        return envelopeNamespace;
     }
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java Mon Apr 18 21:42:52 2005
@@ -27,14 +27,8 @@
 import org.apache.axis.om.SOAPFault;
 import org.apache.axis.om.SOAPHeader;
 import org.apache.axis.om.SOAPHeaderBlock;
-import org.apache.axis.om.impl.llom.OMElementImpl;
-import org.apache.axis.om.impl.llom.OMNamespaceImpl;
-import org.apache.axis.om.impl.llom.OMTextImpl;
-import org.apache.axis.om.impl.llom.SOAPBodyImpl;
-import org.apache.axis.om.impl.llom.SOAPEnvelopeImpl;
-import org.apache.axis.om.impl.llom.SOAPFaultImpl;
-import org.apache.axis.om.impl.llom.SOAPHeaderBlockImpl;
-import org.apache.axis.om.impl.llom.SOAPHeaderImpl;
+import org.apache.axis.om.impl.llom.*;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 
 import javax.xml.namespace.QName;
 
@@ -264,8 +258,8 @@
     public SOAPEnvelope getDefaultEnvelope() {
         // Create an envelope
         OMNamespace ns =
-        new OMNamespaceImpl(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI,
-                OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX);
+        new OMNamespaceImpl(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
         SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns);
         SOAPBodyImpl bodyImpl = new SOAPBodyImpl(env);
         env.addChild(bodyImpl);

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/OMChildrenQNameIteratorTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/OMChildrenQNameIteratorTest.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/OMChildrenQNameIteratorTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/OMChildrenQNameIteratorTest.java Mon Apr 18 21:42:52 2005
@@ -17,6 +17,7 @@
 
 import org.apache.axis.om.impl.llom.builder.StAXSOAPModelBuilder;
 import org.apache.axis.om.impl.llom.traverse.OMChildrenQNameIterator;
+import org.apache.axis.om.impl.llom.SOAPConstants;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
@@ -25,6 +26,7 @@
 
 public class OMChildrenQNameIteratorTest extends AbstractTestCase {
     private SOAPEnvelope envelope = null;
+    StAXSOAPModelBuilder stAXSOAPModelBuilder;
 
     public OMChildrenQNameIteratorTest(String testName) {
         super(testName);
@@ -33,7 +35,8 @@
     OMChildrenQNameIterator omChildrenQNameIterator;
 
     protected void setUp() throws Exception {
-        envelope = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(getTestResourceFile("soap/soapmessage1.xml")))).getSOAPEnvelope();
+        stAXSOAPModelBuilder = new StAXSOAPModelBuilder(XMLInputFactory.newInstance().createXMLStreamReader(new FileReader(getTestResourceFile("soap/soapmessage1.xml"))));
+        envelope = stAXSOAPModelBuilder.getSOAPEnvelope();
     }
 
     protected void tearDown() throws Exception {
@@ -41,9 +44,10 @@
     }
 
     private QName getBodyQname() {
-        return new QName(OMConstants.BODY_NAMESPACE_URI,
-                OMConstants.BODY_LOCAL_NAME,
-                OMConstants.BODY_NAMESPACE_PREFIX);
+
+        return new QName(stAXSOAPModelBuilder.getEnvelopeNamespace().getName(),
+                SOAPConstants.BODY_LOCAL_NAME,
+                stAXSOAPModelBuilder.getEnvelopeNamespace().getPrefix());
     }
 
     public void testIterator() {

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/factory/OMLinkedListImplFactoryTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/factory/OMLinkedListImplFactoryTest.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/factory/OMLinkedListImplFactoryTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/factory/OMLinkedListImplFactoryTest.java Mon Apr 18 21:42:52 2005
@@ -28,6 +28,8 @@
 import org.apache.axis.om.SOAPFault;
 import org.apache.axis.om.SOAPHeader;
 import org.apache.axis.om.SOAPHeaderBlock;
+import org.apache.axis.om.impl.llom.SOAPConstants;
+import org.apache.axis.om.impl.llom.soap11.SOAP11Constants;
 
 /**
  * User: Eran Chinthaka (eran.chinthaka@gmail.com)
@@ -103,7 +105,7 @@
 
     public void testCreateSOAPEnvelope() {
         try {
-            OMNamespace soapNamespace = omFactory.createOMNamespace(OMConstants.SOAP_ENVELOPE_NAMESPACE_URI, OMConstants.SOAPENVELOPE_NAMESPACE_PREFIX);
+            OMNamespace soapNamespace = omFactory.createOMNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX);
             SOAPEnvelope soapEnvelopeTwo = omFactory.createSOAPEnvelope(soapNamespace);
             assertTrue("Programatically created SOAPEnvelope should have done = true ", soapEnvelopeTwo.isComplete());
             SOAPEnvelope soapEnvelope = omFactory.createSOAPEnvelope(soapNamespace, OMTestUtils.getOMBuilder(getTestResourceFile("soap/minimalMessage.xml")));

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/impl/serializer/ElementSerializerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/impl/serializer/ElementSerializerTest.java?view=diff&r1=161837&r2=161838
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/impl/serializer/ElementSerializerTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis/om/impl/serializer/ElementSerializerTest.java Mon Apr 18 21:42:52 2005
@@ -79,16 +79,12 @@
     }
 
     public void testElement() throws Exception {
-        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFactory.newInstance(),
-                reader);
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
         SOAPBody body = env.getBody();
         body.serialize(writer, true);
     }
 
     public void testCompleteElement() throws Exception {
-        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMFactory.newInstance(),
-                reader);
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
         env.serialize(writer, true);
     }