You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ve...@apache.org on 2005/06/03 16:23:50 UTC

svn commit: r179795 [3/4] - in /webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject: ./ bin/ src/org/apache/axis/encoding/ src/org/apache/axis/om/ src/org/apache/axis/om/impl/llom/ src/org/apache/axis/om/impl/llom/builder/ src/org/apache/axis/om/impl/llom/factory/ src/org/apache/axis/om/impl/llom/mtom/ src/org/apache/axis/om/impl/llom/serialize/ src/org/apache/axis/om/impl/llom/traverse/ src/org/apache/axis/om/impl/llom/util/ src/org/apache/axis/om/impl/mtom/ src/org/apache/axis/soap/ src/org/apache/axis/soap/impl/ src/org/apache/axis/soap/impl/llom/ src/org/apache/axis/soap/impl/llom/builder/ src/org/apache/axis/soap/impl/llom/factory/ src/org/apache/axis/soap/impl/llom/soap11/ src/org/apache/axis/soap/impl/llom/soap12/ test/org/ test/org/apache/ test/org/apache/axis/ test/org/apache/axis/om/ test/org/apache/axis/om/infoset/

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeader.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeader.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeader.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap;
+
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMException;
+import org.apache.axis.om.OMNamespace;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Interface SOAPHeader
+ */
+public interface SOAPHeader extends OMElement {
+    /**
+     * Creates a new <CODE>SOAPHeaderBlock</CODE> object
+     * initialized with the specified name and adds it to this
+     * <CODE>SOAPHeader</CODE> object.
+     *
+     * @param localName
+     * @param ns
+     * @return the new <CODE>SOAPHeaderBlock</CODE> object that
+     *         was inserted into this <CODE>SOAPHeader</CODE>
+     *         object
+     * @throws org.apache.axis.om.OMException if a SOAP error occurs
+     */
+    public abstract SOAPHeaderBlock addHeaderBlock(
+            String localName, OMNamespace ns) throws OMException;
+
+    /**
+     * Returns a list of all the <CODE>SOAPHeaderBlock</CODE>
+     * objects in this <CODE>SOAPHeader</CODE> object that have the
+     * the specified role. An role is a global attribute that
+     * indicates the intermediate parties to whom the message should
+     * be sent. An role receives the message and then sends it to
+     * the next role. The default role is the ultimate intended
+     * recipient for the message, so if no role attribute is
+     * included in a <CODE>SOAPHeader</CODE> object, the message is
+     * sent to its ultimate destination.
+     *
+     * @param role a <CODE>String</CODE> giving the
+     *              URI of the role for which to search
+     * @return an <CODE>Iterator</CODE> object over all the <CODE>
+     *         SOAPHeaderBlock</CODE> objects that contain the
+     *         specified role
+     * @see #extractHeaderBlocks(java.lang.String) extractHeaderBlocks(java.lang.String)
+     */
+    public abstract Iterator examineHeaderBlocks(String role);
+
+    /**
+     * Returns a list of all the <CODE>SOAPHeaderBlock</CODE>
+     * objects in this <CODE>SOAPHeader</CODE> object that have
+     * the the specified role and detaches them from this <CODE>
+     * SOAPHeader</CODE> object.
+     * <P>This method allows an role to process only the parts of
+     * the <CODE>SOAPHeader</CODE> object that apply to it and to
+     * remove them before passing the message on to the next
+     * role.
+     *
+     * @param role a <CODE>String</CODE> giving the
+     *              URI of the role for which to search
+     * @return an <CODE>Iterator</CODE> object over all the <CODE>
+     *         SOAPHeaderBlock</CODE> objects that contain the
+     *         specified role
+     * @see #examineHeaderBlocks(java.lang.String) examineHeaderBlocks(java.lang.String)
+     */
+    public abstract Iterator extractHeaderBlocks(String role);
+
+    /**
+     * Returns an <code>Iterator</code> over all the
+     * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader</code>
+     * object that have the specified role and that have a MustUnderstand
+     * attribute whose value is equivalent to <code>true</code>.
+     *
+     * @param role a <code>String</code> giving the URI of the role for which
+     *              to search
+     * @return an <code>Iterator</code> object over all the
+     *         <code>SOAPHeaderBlock</code> objects that contain the
+     *         specified role and are marked as MustUnderstand
+     */
+    public abstract Iterator examineMustUnderstandHeaderBlocks(String role);
+
+    /**
+     * Returns an <code>Iterator</code> over all the
+     * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader</code>
+     * object.
+     *
+     * @return an <code>Iterator</code> object over all the
+     *         <code>SOAPHeaderBlock</code> objects contained by this
+     *         <code>SOAPHeader</code>
+     */
+    public abstract Iterator examineAllHeaderBlocks();
+
+    /**
+     * Returns an <code>Iterator</code> over all the
+     * <code>SOAPHeaderBlock</code> objects in this <code>SOAPHeader </code>
+     * object and detaches them from this <code>SOAPHeader</code> object.
+     *
+     * @return an <code>Iterator</code> object over all the
+     *         <code>SOAPHeaderBlock</code> objects contained by this
+     *         <code>SOAPHeader</code>
+     */
+    public abstract Iterator extractAllHeaderBlocks();
+    
+    /**
+     * Return all the Headers that has the Namespace URI to given NS URI 
+     * @param nsURI
+     * @return
+     */
+    public ArrayList getHeaderBolcksWithNSURI(String nsURI);
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeaderBlock.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeaderBlock.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeaderBlock.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPHeaderBlock.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap;
+
+import org.apache.axis.om.OMElement;
+
+/**
+ * <P>An object representing the contents in the SOAP header part of the SOAP
+ * envelope. The immediate children of a <CODE> SOAPHeader</CODE> object can be
+ * represented only as <CODE> SOAPHeaderBlock</CODE> objects.</P> <P>B
+ * <CODE>SOAPHeaderBlock</CODE> object can have other <CODE>OMElement</CODE>
+ * objects as its children.</P>
+ */
+public interface SOAPHeaderBlock extends OMElement {
+    /**
+     * Sets the actor associated with this <CODE> SOAPHeaderBlock</CODE> object
+     * to the specified actor. The default value of an actor is: <CODE>
+     * OMConstants.URI_SOAP_ACTOR_NEXT</CODE>
+     *
+     * @param roleURI a <CODE>String</CODE> giving the URI of the actor to set
+     * @throws java.lang.IllegalArgumentException
+     *          if there is a problem in setting the actor.
+     * @see #getRole() getRole()
+     */
+    public abstract void setRole(String roleURI);
+
+    /**
+     * Returns the uri of the actor associated with this <CODE>
+     * SOAPHeaderBlock</CODE> object.
+     *
+     * @return a <CODE>String</CODE> giving the URI of the actor
+     * @see #setRole(java.lang.String) setRole(java.lang.String)
+     */
+    public abstract String getRole();
+
+    /**
+     * Sets the mustUnderstand attribute for this <CODE> SOAPHeaderBlock</CODE>
+     * object to be on or off. <P>If the mustUnderstand attribute is on, the
+     * actor who receives the <CODE>SOAPHeaderBlock</CODE> must process it
+     * correctly. This ensures, for example, that if the <CODE>
+     * SOAPHeaderBlock</CODE> object modifies the message, that the message is
+     * being modified correctly.</P>
+     *
+     * @param mustUnderstand <CODE>true</CODE> to set the mustUnderstand
+     *                       attribute on; <CODE>false</CODE> to turn if off
+     * @throws java.lang.IllegalArgumentException
+     *          if there is a problem in setting the actor.
+     * @see #getMustUnderstand() getMustUnderstand()
+     */
+    public abstract void setMustUnderstand(boolean mustUnderstand);
+
+    /**
+     * Returns whether the mustUnderstand attribute for this
+     * <CODE>SOAPHeaderBlock</CODE> object is turned on.
+     *
+     * @return <CODE>true</CODE> if the mustUnderstand attribute of this
+     *         <CODE>SOAPHeaderBlock</CODE> object is turned on;
+     *         <CODE>false</CODE> otherwise
+     */
+    public abstract boolean getMustUnderstand();
+
+
+    public abstract boolean isProcessed();
+
+     /**
+     * We need to know whether all the mustUnderstand headers have been
+     * processed by the node. This will done by a specific validation handler at
+     * the end of the execution chain. For this all the handlers who process a
+     * particular header block must explicitly say that he processesd the header
+     * by calling setProcessed()
+     *
+     */
+    public abstract void setProcessed();
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPText.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPText.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPText.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/SOAPText.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,36 @@
+package org.apache.axis.soap;
+
+import org.apache.axis.om.OMElement;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public interface SOAPText extends OMElement{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+    /**
+     * lang is a mandatory attribute within the SOAPText which must have
+     * SOAP12Constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_URI as the namespace URI and
+     * SOAP12constants.SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX or a capitalization thereof as the prefix
+     * @param lang
+     */
+    public void setLang(String lang);
+    public String getLang();
+
+    
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPBodyImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPBodyImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPBodyImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPBodyImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap.impl.llom;
+
+import org.apache.axis.om.OMConstants;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMException;
+import org.apache.axis.om.OMXMLParserWrapper;
+import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.soap.SOAPBody;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPFault;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+
+/**
+ * Class SOAPBodyImpl
+ */
+public class SOAPBodyImpl extends OMElementImpl
+        implements SOAPBody, OMConstants {
+    /**
+     * Field hasSOAPFault
+     */
+    private boolean hasSOAPFault = false;
+    
+    /**
+     * @param envelope
+     */
+    public SOAPBodyImpl(SOAPEnvelope envelope) {
+        super(envelope);
+        this.ns = envelope.getNamespace();
+        this.localName = SOAPConstants.BODY_LOCAL_NAME;
+    }
+
+    /**
+     * Constructor SOAPBodyImpl
+     *
+     * @param envelope
+     * @param builder
+     */
+    public SOAPBodyImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
+        super(SOAPConstants.BODY_LOCAL_NAME, envelope.getNamespace(), envelope,
+                builder);
+    }
+
+    /**
+     * Creates a new <code>SOAPFault</code> object and adds it to
+     * this <code>SOAPBody</code> object.
+     *
+     * @param e
+     * @return the new <code>SOAPFault</code> object
+     * @throws org.apache.axis.om.OMException if there is a SOAP error
+     * @throws OMException
+     */
+    public SOAPFault addFault(Exception e) throws OMException {
+        SOAPFault soapFault = new SOAPFaultImpl(this, e);
+        addFault(soapFault);
+        return soapFault;
+    }
+
+    /**
+     * Indicates whether a <code>SOAPFault</code> object exists in
+     * this <code>SOAPBody</code> object.
+     *
+     * @return <code>true</code> if a <code>SOAPFault</code> object exists in
+     *         this <code>SOAPBody</code> object; <code>false</code>
+     *         otherwise
+     */
+    public boolean hasFault() {
+        if (hasSOAPFault) {
+            return true;
+        } else {
+            OMElement element = getFirstElement();
+            if(element != null 
+                && SOAPConstants.SOAPFAULT_LOCAL_NAME.equals(element.getLocalName())
+                && SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(element.getNamespace().getName())){
+                hasSOAPFault = true;
+                return true;
+            }else{
+                return false;
+            }
+        }
+    }
+
+    /**
+     * Returns the <code>SOAPFault</code> object in this <code>SOAPBody</code>
+     * object.
+     *
+     * @return the <code>SOAPFault</code> object in this <code>SOAPBody</code>
+     *         object
+     */
+    public SOAPFault getFault() {
+        if(hasSOAPFault){
+            OMElement element = getFirstElement();
+            if(element != null 
+                && SOAPConstants.SOAPFAULT_LOCAL_NAME.equals(element.getLocalName())
+                && SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(element.getNamespace().getName())){
+                hasSOAPFault = true;
+                return (SOAPFault)element;
+            }else{
+                return null;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * @param soapFault
+     * @throws org.apache.axis.om.OMException
+     * @throws OMException
+     */
+    public void addFault(SOAPFault soapFault) throws OMException {
+        if (hasSOAPFault) {
+            throw new OMException(
+                    "SOAP Body already has a SOAP Fault and there can not be more than one SOAP fault");
+        }
+        addChild(soapFault);
+        hasSOAPFault = true;
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPConstants.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPConstants.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPConstants.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,84 @@
+package org.apache.axis.soap.impl.llom;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public interface SOAPConstants {
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+    /**
+     * Field SOAP_DEFAULT_NAMESPACE_PREFIX
+     */
+    public static final String SOAP_DEFAULT_NAMESPACE_PREFIX = "soapenv";
+    /**
+     * Field SOAPENVELOPE_LOCAL_NAME
+     */
+    public static final String SOAPENVELOPE_LOCAL_NAME = "Envelope";
+
+    /**
+     * Field HEADER_LOCAL_NAME
+     */
+    public static final String HEADER_LOCAL_NAME = "Header";
+
+    /**
+     * Field BODY_LOCAL_NAME
+     */
+    public static final String BODY_LOCAL_NAME = "Body";
+    /**
+     * Field BODY_NAMESPACE_PREFIX
+     */
+    public static final String BODY_NAMESPACE_PREFIX =
+            SOAP_DEFAULT_NAMESPACE_PREFIX;
+    /**
+     * Field BODY_FAULT_LOCAL_NAME
+     */
+    public static final String BODY_FAULT_LOCAL_NAME = "Fault";
+    /**
+     * 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_PREFIX
+     */
+    public static final String SOAPFAULT_NAMESPACE_PREFIX =
+            SOAP_DEFAULT_NAMESPACE_PREFIX;
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPEnvelopeImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap.impl.llom;
+
+import org.apache.axis.om.*;
+import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.soap.SOAPBody;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPHeader;
+
+/**
+ * Class SOAPEnvelopeImpl
+ */
+public class SOAPEnvelopeImpl extends OMElementImpl
+        implements SOAPEnvelope, OMConstants {
+
+    private SOAPBody soapBody;
+    private SOAPHeader soapHeader;
+
+    /**
+     * @param builder
+     */
+    public SOAPEnvelopeImpl(OMXMLParserWrapper builder) {
+        super(SOAPConstants.SOAPENVELOPE_LOCAL_NAME, null, null, builder);
+    }
+
+    /**
+     * Constructor SOAPEnvelopeImpl
+     *
+     * @param ns
+     * @param builder
+     */
+    public SOAPEnvelopeImpl(OMNamespace ns, OMXMLParserWrapper builder) {
+        super(SOAPConstants.SOAPENVELOPE_LOCAL_NAME, ns, null, builder);
+    }
+
+    /**
+     * @param ns
+     */
+    public SOAPEnvelopeImpl(OMNamespace ns) {
+        super(SOAPConstants.SOAPENVELOPE_LOCAL_NAME, ns);
+    }
+
+    /**
+     * Returns the <CODE>SOAPHeader</CODE> object for this <CODE>
+     * SOAPEnvelope</CODE> object. <P> This SOAPHeader will just be a container
+     * for all the headers in the <CODE>OMMessage</CODE> </P>
+     *
+     * @return the <CODE>SOAPHeader</CODE> object or <CODE> null</CODE> if there
+     *         is none
+     * @throws org.apache.axis.om.OMException if there is a problem obtaining
+     *                                        the <CODE>SOAPHeader</CODE>
+     *                                        object
+     * @throws OMException
+     */
+    public SOAPHeader getHeader() throws OMException {
+        if (soapHeader == null) {
+            OMElement element = getFirstElement();
+            if (SOAPConstants.HEADER_LOCAL_NAME.equals(element.getLocalName())) {
+                soapHeader = (SOAPHeader) element;
+            }
+        }
+        return soapHeader;
+    }
+
+    /**
+     * Returns the <CODE>SOAPBody</CODE> object associated with this
+     * <CODE>SOAPEnvelope</CODE> object. <P> This SOAPBody will just be a
+     * container for all the BodyElements in the <CODE>OMMessage</CODE> </P>
+     *
+     * @return the <CODE>SOAPBody</CODE> object for this <CODE>
+     *         SOAPEnvelope</CODE> object or <CODE>null</CODE> if there is none
+     * @throws org.apache.axis.om.OMException if there is a problem obtaining
+     *                                        the <CODE>SOAPBody</CODE> object
+     * @throws OMException
+     */
+    public SOAPBody getBody() throws OMException {
+        if (soapBody == null) {
+            OMElement element = getFirstElement();
+            if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
+                soapBody = (SOAPBody) element;
+            } else {
+                OMNode node = element.getNextSibling();
+                while (node.getType() != OMNode.ELEMENT_NODE) {
+                    node = node.getNextSibling();
+                }
+                element = (OMElement) node;
+
+                if (SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
+                    soapBody = (SOAPBody) element;
+                }
+            }
+        }
+        return soapBody;
+    }
+
+    /**
+     * Method detach
+     *
+     * @throws OMException
+     */
+    public OMNode detach() throws OMException {
+        throw new OMException("Root Element can not be detached");
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaulReasonImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaulReasonImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaulReasonImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaulReasonImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,48 @@
+package org.apache.axis.soap.impl.llom;
+
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.soap.SOAPFaultReason;
+import org.apache.axis.soap.SOAPText;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public class SOAPFaulReasonImpl extends OMElementImpl implements SOAPFaultReason {
+
+    
+    /**
+     * @param parent
+     * @param parent
+     */
+    public SOAPFaulReasonImpl(OMElement parent) {
+        super(parent);
+    }
+
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+    private SOAPText soapText;
+
+    public void setSOAPText(SOAPText soapText) {
+        this.soapText = soapText;
+    }
+
+    public SOAPText getSOAPText() {
+        return this.soapText;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaultImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaultImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPFaultImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,337 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap.impl.llom;
+
+import org.apache.axis.om.*;
+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.soap.*;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Iterator;
+
+/**
+ * Class SOAPFaultImpl
+ */
+public class SOAPFaultImpl extends OMElementImpl
+        implements SOAPFault, OMConstants {
+    /**
+     * Field e
+     */
+    private Exception e;
+
+    /**
+     * Field faultCodeElement
+     */
+    private OMElement faultCodeElement;
+
+    /**
+     * Field faultActorElement
+     */
+    private OMElement faultActorElement;
+
+    /**
+     * Field faultStringElement
+     */
+    private OMElement faultStringElement;
+
+    /**
+     * Field detailElement
+     */
+    private OMElement detailElement;
+
+    /**
+     * Constructor SOAPFaultImpl
+     *
+     * @param parent
+     * @param e
+     */
+    public SOAPFaultImpl(OMElement parent, Exception e) {
+        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();
+        e.printStackTrace(new PrintWriter(sw));
+        this.setDetailInformation(OMAbstractFactory.getSOAP11Factory().createText(sw.getBuffer().toString()));
+    }
+
+    /**
+     * Constructor SOAPFaultImpl
+     *
+     * @param ns
+     * @param parent
+     * @param builder
+     */
+    public SOAPFaultImpl(OMNamespace ns, OMElement parent,
+                         OMXMLParserWrapper builder) {
+        super(SOAPConstants.SOAPFAULT_LOCAL_NAME, ns, parent, builder);
+    }
+
+    /**
+     * Method setCode
+     *
+     * @param faultCode
+     * @throws OMException
+     */
+    public void setCode(SOAPFaultCode faultCode) throws OMException {
+        if (faultCodeElement != null) {
+            faultCodeElement.detach();
+        }
+        faultCodeElement =
+        new OMElementImpl(SOAPConstants.SOAPFAULT_CODE_LOCAL_NAME, this.ns);
+        this.addChild(faultCodeElement);
+        faultCodeElement.addChild(new OMTextImpl(faultCodeElement,
+                        faultCode.getNamespace().getPrefix() + ':'
+                                + faultCode.getLocalName()));
+    }
+
+    /**
+     * Method getCode
+     *
+     * @return
+     */
+    public SOAPFaultCode getCode() {
+//        if (faultCodeElement != null) {
+//            Iterator childrenIter = faultCodeElement.getChildren();
+//            while (childrenIter.hasNext()) {
+//                Object o = childrenIter.next();
+//                if ((o instanceof OMText)
+//                        && !((OMText) o).getText().trim().equals("")) {
+//                    String[] strings = ((OMText) o).getText().split(":");
+//                    return new QName("", strings[1], strings[0]);
+//                }
+//            }
+//        } else {
+//            faultCodeElement =  this.getFirstChildWithName(
+//                    new QName(
+//                            this.ns.getName(), SOAPConstants.SOAPFAULT_CODE_LOCAL_NAME,
+//                            this.ns.getPrefix()));
+//            if (faultCodeElement != null) {
+//                return this.getCode();
+//            }
+//        }
+        return null;
+    }
+
+    public void setReason(SOAPFaultReason reason) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public SOAPFaultReason getReason() {
+
+
+        SOAPFaultReason faultReason = new SOAPFaulReasonImpl(this);
+        SOAPText soapText = new SOAPTextImpl(faultReason);
+        soapText.setText(this.getFaultString());
+
+        faultReason.setSOAPText(soapText);
+        return faultReason;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void setNode(SOAPFaultNode node) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public SOAPFaultNode getNode() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void setRole(SOAPFaultRole role) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public SOAPFaultRole getRole() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void setDetail(SOAPFaultDetail detail) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public SOAPFaultDetail getDetail() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    /**
+     * Method setFaultActor
+     *
+     * @param faultActor
+     * @throws OMException
+     */
+    public void setFaultActor(String faultActor) throws OMException {
+        if (faultActorElement != null) {
+            faultActorElement.detach();
+        }
+        faultActorElement =
+        new OMElementImpl(SOAPConstants.SOAPFAULT_ACTOR_LOCAL_NAME, this.ns);
+        this.addChild(faultActorElement);
+        faultActorElement.addChild(new OMTextImpl(faultActorElement,
+                        faultActor));
+    }
+
+    /**
+     * Method getFaultActor
+     *
+     * @return
+     */
+    public String getFaultActor() {
+        if (faultActorElement != null) {
+            Iterator childrenIter = faultActorElement.getChildren();
+            while (childrenIter.hasNext()) {
+                Object o = childrenIter.next();
+                if ((o instanceof OMText)
+                        && !"".equals(((OMText) o).getText())) {
+                    return ((OMText) o).getText();
+                }
+            }
+        } else {
+            faultActorElement = this.getFirstChildWithName(
+                    new QName(
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_ACTOR_LOCAL_NAME,
+                            this.ns.getPrefix()));
+            if (faultActorElement != null) {
+                return this.getFaultString();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Method setFaultString
+     *
+     * @param faultString
+     * @throws OMException
+     */
+    public void setFaultString(String faultString) throws OMException {
+        if (faultStringElement != null) {
+            faultStringElement.detach();
+        }
+        faultStringElement =
+        new OMElementImpl(SOAPConstants.SOAPFAULT_STRING_LOCAL_NAME, this.ns);
+        this.addChild(faultStringElement);
+        faultStringElement.addChild(new OMTextImpl(faultStringElement,
+                        faultString));
+    }
+
+    /**
+     * Method getFaultString
+     *
+     * @return
+     */
+    public String getFaultString() {
+        if (faultStringElement != null) {
+            Iterator childrenIter = faultStringElement.getChildren();
+            while (childrenIter.hasNext()) {
+                Object o = childrenIter.next();
+                if ((o instanceof OMText)
+                        && !"".equals(((OMText) o).getText())) {
+                    return ((OMText) o).getText();
+                }
+            }
+        } else {
+            faultStringElement =  this.getFirstChildWithName(
+                    new QName(
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_STRING_LOCAL_NAME,
+                            this.ns.getPrefix()));
+            if (faultStringElement != null) {
+                return this.getFaultString();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Method setDetailInformation
+     *
+     * @param detailInformation
+     */
+    public void setDetailInformation(OMNode detailInformation) {
+        if (detailElement != null) {
+            detailElement.detach();
+        }
+        detailElement =
+        new OMElementImpl(SOAPConstants.SOAPFAULT_DETAIL_LOCAL_NAME, this.ns);
+        this.addChild(detailElement);
+        detailElement.addChild(detailInformation);
+    }
+
+    /**
+     * Method getDetailInformation
+     *
+     * @return
+     */
+    public OMNode getDetailInformation() {
+        if (detailElement != null) {
+            Iterator childrenIter = detailElement.getChildren();
+            while (childrenIter.hasNext()) {
+                Object o = childrenIter.next();
+                if (!((o instanceof OMText)
+                                 && "".equals(((OMText) o).getText()))) {
+                    return (OMNode) o;
+                }
+            }
+        } else {
+            detailElement = this.getFirstChildWithName(
+                    new QName(
+                            this.ns.getName(), SOAPConstants.SOAPFAULT_DETAIL_LOCAL_NAME,
+                            this.ns.getPrefix()));
+            if (detailElement != null) {
+                return detailElement;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Method getException
+     *
+     * @return
+     * @throws OMException
+     */
+    public Exception getException() throws OMException {
+        if (e == null) {
+            OMNode detailsInformationNode = this.getDetailInformation();
+            if (detailsInformationNode instanceof OMElement) {
+                try {
+                    StringWriter sw = new StringWriter();
+                    XMLStreamWriter writer =
+                            XMLOutputFactory.newInstance().createXMLStreamWriter(
+                            sw);
+                    ((OMElement) detailsInformationNode).serializeWithCache(writer);
+                    writer.flush();
+                    return new Exception(sw.toString());
+                } catch (XMLStreamException e1) {
+                    throw new OMException("Exception in StAX Writer", e1);
+                }
+            } else if (detailsInformationNode instanceof OMText) {
+                return new Exception(
+                        ((OMText) detailsInformationNode).getText());
+            }
+        } else {
+            return e;
+        }
+        return null;
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderBlockImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderBlockImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderBlockImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,165 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap.impl.llom;
+
+import org.apache.axis.om.OMAttribute;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OMXMLParserWrapper;
+import org.apache.axis.om.impl.llom.OMAttributeImpl;
+import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.om.impl.llom.OMNamespaceImpl;
+import org.apache.axis.soap.SOAPHeaderBlock;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Class SOAPHeaderBlockImpl
+ */
+public class SOAPHeaderBlockImpl extends OMElementImpl
+        implements SOAPHeaderBlock {
+
+    private boolean processed = false;
+    /**
+     * @param localName
+     * @param ns
+     */
+    public SOAPHeaderBlockImpl(String localName, OMNamespace ns) {
+        super(localName, ns);
+    }
+
+    /**
+     * Constructor SOAPHeaderBlockImpl
+     *
+     * @param localName
+     * @param ns
+     * @param parent
+     * @param builder
+     */
+    public SOAPHeaderBlockImpl(String localName, OMNamespace ns,
+                               OMElement parent, OMXMLParserWrapper builder) {
+        super(localName, ns, parent, builder);
+    }
+
+    /**
+     * Sets the actor associated with this <CODE>
+     * SOAPHeaderBlock</CODE> object to the specified actor. The
+     * default value of an actor is: <CODE>
+     * OMConstants.URI_SOAP_ACTOR_NEXT</CODE>
+     *
+     * @param actorURI a <CODE>String</CODE> giving
+     *                 the URI of the actor to set
+     * @throws IllegalArgumentException if
+     *                                  there is a problem in setting the actor.
+     * @see #getRole() getRole()
+     */
+    public void setRole(String actorURI) {
+        setAttribute(SOAPConstants.ATTR_ACTOR, actorURI);
+    }
+
+    /**
+     * @param attributeName
+     * @param attrValue
+     */
+    private void setAttribute(String attributeName, String attrValue) {
+        OMAttribute omAttribute = this.getFirstAttribute(
+                new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, attributeName));
+        if (omAttribute != null) {
+            omAttribute.setValue(attrValue);
+        } else {
+            OMAttribute attribute = new OMAttributeImpl(
+                    attributeName,
+                    new OMNamespaceImpl(
+                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                            SOAPConstants.SOAP_DEFAULT_NAMESPACE_PREFIX), attrValue);
+            this.addAttribute(attribute);
+        }
+    }
+
+    /**
+     * Returns the uri of the actor associated with this <CODE>
+     * SOAPHeaderBlock</CODE> object.
+     *
+     * @return a <CODE>String</CODE> giving the URI of the
+     *         actor
+     * @see #setRole(String) setRole(java.lang.String)
+     */
+    public String getRole() {
+        return getAttribute(SOAPConstants.ATTR_ACTOR);
+    }
+
+    /**
+     * Method getAttribute
+     *
+     * @param attrName
+     * @return
+     */
+    private String getAttribute(String attrName) {
+        OMAttribute omAttribute = this.getFirstAttribute(
+                new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, attrName));
+        return (omAttribute != null)
+                ? omAttribute.getValue()
+                : null;
+    }
+
+    /**
+     * Sets the mustUnderstand attribute for this <CODE>
+     * SOAPHeaderBlock</CODE> object to be on or off.
+     * <P>If the mustUnderstand attribute is on, the actor who
+     * receives the <CODE>SOAPHeaderBlock</CODE> must process it
+     * correctly. This ensures, for example, that if the <CODE>
+     * SOAPHeaderBlock</CODE> object modifies the message, that
+     * the message is being modified correctly.</P>
+     *
+     * @param mustUnderstand <CODE>true</CODE> to
+     *                       set the mustUnderstand attribute on; <CODE>false</CODE>
+     *                       to turn if off
+     * @throws IllegalArgumentException if
+     *                                  there is a problem in setting the actor.
+     * @see #getMustUnderstand() getMustUnderstand()
+     */
+    public void setMustUnderstand(boolean mustUnderstand) {
+        setAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND, mustUnderstand
+                        ? "true"
+                        : "false");
+    }
+
+    /**
+     * Returns whether the mustUnderstand attribute for this
+     * <CODE>SOAPHeaderBlock</CODE> object is turned on.
+     *
+     * @return <CODE>true</CODE> if the mustUnderstand attribute of
+     *         this <CODE>SOAPHeaderBlock</CODE> object is turned on;
+     *         <CODE>false</CODE> otherwise
+     */
+    public boolean getMustUnderstand() {
+        String mustUnderstand = "";
+        if ((mustUnderstand = getAttribute(SOAPConstants.ATTR_MUSTUNDERSTAND))
+                != null) {
+            return mustUnderstand.equalsIgnoreCase("true") || mustUnderstand.equalsIgnoreCase("1") ;
+        }
+        return false;
+    }
+
+    public boolean isProcessed() {
+        return processed;
+    }
+
+    public void setProcessed() {
+        processed = true;
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPHeaderImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,207 @@
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed 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.axis.soap.impl.llom;
+
+import org.apache.axis.om.*;
+import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.om.impl.llom.traverse.OMChildrenWithSpecificAttributeIterator;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPHeader;
+import org.apache.axis.soap.SOAPHeaderBlock;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Class SOAPHeaderImpl
+ */
+public class SOAPHeaderImpl extends OMElementImpl implements SOAPHeader {
+    /**
+     * @param envelope
+     */
+    public SOAPHeaderImpl(SOAPEnvelope envelope) {
+        super(envelope);
+
+        // set the namespaces
+        this.ns = envelope.getNamespace();
+        this.localName = SOAPConstants.HEADER_LOCAL_NAME;
+    }
+
+    /**
+     * Constructor SOAPHeaderImpl
+     *
+     * @param envelope
+     * @param builder
+     */
+    public SOAPHeaderImpl(SOAPEnvelope envelope, OMXMLParserWrapper builder) {
+        super(SOAPConstants.HEADER_LOCAL_NAME,
+                (envelope == null) ? null : envelope.getNamespace(),
+                envelope,
+                builder);
+    }
+
+    /**
+     * Creates a new <CODE>SOAPHeaderBlock</CODE> object initialized with the
+     * specified name and adds it to this <CODE>SOAPHeader</CODE> object.
+     *
+     * @param localName
+     * @param ns
+     * @return the new <CODE>SOAPHeaderBlock</CODE> object that was inserted
+     *         into this <CODE>SOAPHeader</CODE> object
+     * @throws org.apache.axis.om.OMException if a SOAP error occurs
+     * @throws OMException
+     */
+    public SOAPHeaderBlock addHeaderBlock(String localName, OMNamespace ns)
+            throws OMException {
+        if (ns == null || ns.getName() == null || "".equals(ns.getName())) {
+            throw new OMException("All the SOAP Header blocks should be namespace qualified");
+        }
+        SOAPHeaderBlock soapHeaderBlock =
+                new SOAPHeaderBlockImpl(localName, ns);
+        this.addChild(soapHeaderBlock);
+        soapHeaderBlock.setComplete(true);
+        return soapHeaderBlock;
+    }
+
+    /**
+     * Returns a list of all the <CODE>SOAPHeaderBlock</CODE> objects in this
+     * <CODE>SOAPHeader</CODE> object that have the the specified actor. An
+     * actor is a global attribute that indicates the intermediate parties to
+     * whom the message should be sent. An actor receives the message and then
+     * sends it to the next actor. The default actor is the ultimate intended
+     * recipient for the message, so if no actor attribute is included in a
+     * <CODE>SOAPHeader</CODE> object, the message is sent to its ultimate
+     * destination.
+     *
+     * @param paramRole a <CODE>String</CODE> giving the URI of the actor for
+     *                  which to search
+     * @return an <CODE>Iterator</CODE> object over all the <CODE>
+     *         SOAPHeaderBlock</CODE> objects that contain the specified actor
+     * @see #extractHeaderBlocks(String) extractHeaderBlocks(java.lang.String)
+     */
+    public Iterator examineHeaderBlocks(String paramRole) {
+        Iterator headerBlocksIter = this.getChildren();
+        ArrayList headersWithGivenActor = new ArrayList();
+        while (headerBlocksIter.hasNext()) {
+            Object o = headerBlocksIter.next();
+            if (o instanceof SOAPHeaderBlock) {
+                SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) o;
+                String role = soapHeaderBlock.getRole();
+                if ((role != null) && role.equalsIgnoreCase(paramRole)) {
+                    headersWithGivenActor.add(soapHeaderBlock);
+                }
+            }
+        }
+        return headersWithGivenActor.iterator();
+    }
+
+    /**
+     * Returns a list of all the <CODE>SOAPHeaderBlock</CODE> objects in this
+     * <CODE>SOAPHeader</CODE> object that have the the specified actor and
+     * detaches them from this <CODE> SOAPHeader</CODE> object. <P>This method
+     * allows an actor to process only the parts of the <CODE>SOAPHeader</CODE>
+     * object that apply to it and to remove them before passing the message on
+     * to the next actor.
+     *
+     * @param actor a <CODE>String</CODE> giving the URI of the actor for which
+     *              to search
+     * @return an <CODE>Iterator</CODE> object over all the <CODE>
+     *         SOAPHeaderBlock</CODE> objects that contain the specified actor
+     * @see #examineHeaderBlocks(String) examineHeaderBlocks(java.lang.String)
+     */
+    public Iterator extractHeaderBlocks(String actor) {
+        return new OMChildrenWithSpecificAttributeIterator(getFirstChild(),
+                new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                        SOAPConstants.ATTR_ACTOR),
+                actor,
+                true);
+    }
+
+    /**
+     * Returns an <code>Iterator</code> over all the <code>SOAPHeaderBlock</code>
+     * objects in this <code>SOAPHeader</code> object that have the specified
+     * actor and that have a MustUnderstand attribute whose value is equivalent
+     * to <code>true</code>.
+     *
+     * @param actor a <code>String</code> giving the URI of the actor for which
+     *              to search
+     * @return an <code>Iterator</code> object over all the
+     *         <code>SOAPHeaderBlock</code> objects that contain the specified
+     *         actor and are marked as MustUnderstand
+     */
+    public Iterator examineMustUnderstandHeaderBlocks(String actor) {
+        return new OMChildrenWithSpecificAttributeIterator(getFirstChild(),
+                new QName(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
+                        SOAPConstants.ATTR_ACTOR),
+                actor,
+                false);
+    }
+
+    /**
+     * Returns an <code>Iterator</code> over all the <code>SOAPHeaderBlock</code>
+     * objects in this <code>SOAPHeader</code> object. Not that this will return
+     * elements containing the QName (http://schemas.xmlsoap.org/soap/envelope/,
+     * Header)
+     *
+     * @return an <code>Iterator</code> object over all the
+     *         <code>SOAPHeaderBlock</code> objects contained by this
+     *         <code>SOAPHeader</code>
+     */
+    public Iterator examineAllHeaderBlocks() {
+        return this.getChildrenWithName(null);
+    }
+
+    /**
+     * Returns an <code>Iterator</code> over all the <code>SOAPHeaderBlock</code>
+     * objects in this <code>SOAPHeader </code> object and detaches them from
+     * this <code>SOAPHeader</code> object.
+     *
+     * @return an <code>Iterator</code> object over all the
+     *         <code>SOAPHeaderBlock</code> objects contained by this
+     *         <code>SOAPHeader</code>
+     */
+    public Iterator extractAllHeaderBlocks() {
+        throw new UnsupportedOperationException(); // TODO implement this
+    }
+
+    public ArrayList getHeaderBolcksWithNSURI(String nsURI) {
+        ArrayList headers = null;
+        OMNode node = null;
+        OMElement header = this.getFirstElement();
+
+        if (header != null) {
+            headers = new ArrayList();
+        }
+        
+        node = header;
+        
+        while (node != null) {
+            if (node.getType() == OMNode.ELEMENT_NODE) {
+                header = (OMElement) node;
+                if (nsURI.equals(header.getNamespace().getName())) {
+                    headers.add(header);
+                }
+            }
+            node = node.getNextSibling();
+
+        }
+        return headers;
+
+    }
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPTextImpl.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPTextImpl.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/SOAPTextImpl.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,42 @@
+package org.apache.axis.soap.impl.llom;
+
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.impl.llom.OMElementImpl;
+import org.apache.axis.soap.SOAPText;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public class SOAPTextImpl extends OMElementImpl implements SOAPText{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+    /**
+     * @param parent
+     * @param parent
+     */
+    public SOAPTextImpl(OMElement parent) {
+        super(parent);
+    }
+
+    public void setLang(String lang) {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public String getLang() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,358 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.soap.impl.llom.builder;
+
+import org.apache.axis.om.*;
+import org.apache.axis.om.impl.llom.builder.StAXBuilder;
+import org.apache.axis.om.impl.llom.exception.OMBuilderException;
+import org.apache.axis.soap.SOAPBody;
+import org.apache.axis.soap.SOAPEnvelope;
+import org.apache.axis.soap.SOAPFactory;
+import org.apache.axis.soap.SOAPHeader;
+import org.apache.axis.soap.impl.llom.SOAPConstants;
+import org.apache.axis.soap.impl.llom.SOAPEnvelopeImpl;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Class StAXSOAPModelBuilder
+ */
+public class StAXSOAPModelBuilder extends StAXBuilder {
+    /**
+     * Field envelope
+     */
+    private SOAPEnvelopeImpl envelope;
+    private OMNamespace envelopeNamespace;
+
+    private SOAPFactory soapFactory;
+
+    /**
+     * Field headerPresent
+     */
+    private boolean headerPresent = false;
+
+    /**
+     * Field bodyPresent
+     */
+    private boolean bodyPresent = false;
+
+    /**
+     * Field log
+     */
+    private Log log = LogFactory.getLog(getClass());
+
+    /**
+     * element level 1 = envelope level element level 2 = Header or Body level
+     * element level 3 = HeaderElement or BodyElement level
+     */
+    private int elementLevel = 0;
+
+    /**
+     * Constructor StAXSOAPModelBuilder
+     *
+     * @param parser
+     */
+    public StAXSOAPModelBuilder(XMLStreamReader parser) {
+        super(parser);
+        soapFactory = OMAbstractFactory.getDefaultSOAPFactory();
+        identifySOAPVersion();
+
+        parseHeaders();
+    }
+    
+    public StAXSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory) {
+            super(parser);
+            soapFactory = factory;
+            identifySOAPVersion();
+
+            parseHeaders();
+        }
+
+    private void identifySOAPVersion() {
+        SOAPEnvelope soapEnvelope = getSOAPEnvelope();
+        if(soapEnvelope == null){
+            throw new OMException("No SOAPHeader present !!");
+        }
+
+        envelopeNamespace = soapEnvelope.findNamespace(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
+        if (envelopeNamespace == null) {
+            envelopeNamespace = getSOAPEnvelope().findNamespace(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
+        } else {
+            log.info("SOAP 1.2 message received ..");
+            soapFactory  = OMAbstractFactory.getSOAP12Factory();
+        }
+
+        if (envelopeNamespace == null) {
+            throw new OMException("Invalid SOAP message. Doesn't have proper namespace declaration !!");
+        } else {
+            log.info("SOAP 1.1 message received ..");
+            soapFactory = OMAbstractFactory.getSOAP11Factory();
+        }
+
+        omfactory = soapFactory;
+    }
+
+    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 !!");
+        }
+    }
+
+
+    /**
+     * Method getSOAPEnvelope
+     *
+     * @return
+     * @throws OMException
+     */
+    public SOAPEnvelope getSOAPEnvelope() throws OMException {
+        while ((envelope == null) && !done) {
+            next();
+        }
+        return envelope;
+    }
+
+    /**
+     * Method createOMElement
+     *
+     * @return
+     * @throws OMException
+     */
+    protected OMNode createOMElement() throws OMException {
+        OMElement node;
+        String elementName = parser.getLocalName();
+        if (lastNode == null) {
+            node = constructNode(null, elementName, true);
+        } else if (lastNode.isComplete()) {
+            node = constructNode(lastNode.getParent(), elementName, false);
+            lastNode.setNextSibling(node);
+            node.setPreviousSibling(lastNode);
+        } else {
+            OMElement e = (OMElement) lastNode;
+            node = constructNode((OMElement) lastNode, elementName, false);
+            e.setFirstChild(node);
+        }
+
+        // fill in the attributes
+        processAttributes(node);
+        log.info("Build the OMElelment {" + node.getNamespace().getName() + '}'
+                + node.getLocalName() + "By the StaxSOAPModelBuilder");
+        return node;
+    }
+
+    /**
+     * Method constructNode
+     *
+     * @param parent
+     * @param elementName
+     * @param isEnvelope
+     * @return
+     */
+    protected OMElement constructNode(OMElement parent, String elementName,
+                                    boolean isEnvelope) {
+        OMElement element = null;
+        if (parent == null) {
+            if (!elementName.equalsIgnoreCase(SOAPConstants.SOAPENVELOPE_LOCAL_NAME)) {
+                throw new OMException("First Element must contain the local name, "
+                        + SOAPConstants.SOAPENVELOPE_LOCAL_NAME);
+            }
+            envelope =
+                    (SOAPEnvelopeImpl) soapFactory.createSOAPEnvelope(null,
+                            this);
+            element = envelope;
+            processNamespaceData(element, true);
+        } else if (elementLevel == 2) {
+
+            // this is either a header or a body
+            if (elementName.equals(SOAPConstants.HEADER_LOCAL_NAME)) {
+                if (headerPresent) {
+                    throw new OMBuilderException("Multiple headers encountered!");
+                }
+                if (bodyPresent) {
+                    throw new OMBuilderException("Header Body wrong order!");
+                }
+                headerPresent = true;
+                element =
+                        soapFactory.createSOAPHeader((SOAPEnvelope) parent,
+                                this);
+
+                // envelope.setHeader((SOAPHeader)element);
+                processNamespaceData(element, true);
+            } else if (elementName.equals(SOAPConstants.BODY_LOCAL_NAME)) {
+                if (bodyPresent) {
+                    throw new OMBuilderException("Multiple body elements encountered");
+                }
+                bodyPresent = true;
+                element =
+                        soapFactory.createSOAPBody((SOAPEnvelope) parent,
+                                this);
+
+                // envelope.setBody((SOAPBody)element);
+                processNamespaceData(element, true);
+            } else {
+                throw new OMBuilderException(elementName
+                        + " is not supported here. Envelope can not have elements other than Header and Body.");
+            }
+        } else if ((elementLevel == 3)
+                && parent.getLocalName().equalsIgnoreCase(SOAPConstants.HEADER_LOCAL_NAME)) {
+
+            // this is a headerblock
+            element = soapFactory.createSOAPHeaderBlock(elementName, null,
+                    parent, this);
+            processNamespaceData(element, false);
+        } else if ((elementLevel == 3) && parent.getLocalName().equalsIgnoreCase(SOAPConstants.BODY_LOCAL_NAME) && elementName.equalsIgnoreCase(SOAPConstants.BODY_FAULT_LOCAL_NAME)) {
+
+            // this is a headerblock
+            element = soapFactory.createSOAPFault(null, (SOAPBody) parent,
+                    this);
+            processNamespaceData(element, false);
+        } else {
+
+            // this is neither of above. Just create an element
+            element = soapFactory.createOMElement(elementName, null,
+                    parent, this);
+            processNamespaceData(element, false);
+        }
+        return element;
+    }
+
+    /**
+     * Method next
+     *
+     * @return
+     * @throws OMException
+     */
+    public int next() throws OMException {
+        try {
+            if (done) {
+                throw new OMException();
+            }
+            int token = parser.next();
+            if (!cache) {
+                return token;
+            }
+            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);
+                        lastNode = parent;
+                    } else {
+                        OMElement e = (OMElement) lastNode;
+                        e.setComplete(true);
+                    }
+                    elementLevel--;
+                    break;
+                case XMLStreamConstants.END_DOCUMENT:
+                    done = true;
+                    break;
+                case XMLStreamConstants.SPACE:
+                    next();
+                    break;
+                default :
+                    throw new OMException();
+            }
+            return token;
+        } catch (OMException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new OMException(e);
+        }
+    }
+
+    /**
+     * Method getDocumentElement
+     *
+     * @return
+     */
+    public OMElement getDocumentElement() {
+        return getSOAPEnvelope();
+    }
+
+    /**
+     * Method processNamespaceData
+     *
+     * @param node
+     * @param isSOAPElement
+     */
+    protected void processNamespaceData(OMElement node, boolean isSOAPElement) {
+        int namespaceCount = parser.getNamespaceCount();
+        for (int i = 0; i < namespaceCount; i++) {
+            node.declareNamespace(parser.getNamespaceURI(i),
+                    parser.getNamespacePrefix(i));
+        }
+
+        // set the own namespace
+        String namespaceURI = parser.getNamespaceURI();
+        String prefix = parser.getPrefix();
+        OMNamespace namespace = null;
+        if (!"".equals(namespaceURI)) {
+            if (prefix == null) {
+                // this means, this elements has a default namespace or it has inherited a default namespace from its parent
+                namespace = node.findNamespace(namespaceURI, "");
+                if (namespace == null) {
+                    namespace = node.declareNamespace(namespaceURI, "");
+                }
+            } else {
+                namespace = node.findNamespace(namespaceURI, prefix);
+            }
+            node.setNamespace(namespace);
+        } else {
+
+        }
+
+
+
+        // TODO we got to have this to make sure OM reject mesagess that are not sname space qualified
+        // But got to comment this to interop with Axis.1.x
+        // if (namespace == null) {
+        // throw new OMException("All elements must be namespace qualified!");
+        // }
+        if (isSOAPElement) {
+            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;
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/factory/SOAPLinkedListImplFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/factory/SOAPLinkedListImplFactory.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/factory/SOAPLinkedListImplFactory.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/factory/SOAPLinkedListImplFactory.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,174 @@
+package org.apache.axis.soap.impl.llom.factory;
+
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.OMXMLParserWrapper;
+import org.apache.axis.om.impl.llom.OMNamespaceImpl;
+import org.apache.axis.om.impl.llom.factory.OMLinkedListImplFactory;
+import org.apache.axis.soap.*;
+import org.apache.axis.soap.impl.llom.*;
+import org.apache.axis.soap.impl.llom.SOAPConstants;
+import org.apache.axis.soap.impl.llom.soap11.SOAP11Constants;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public class SOAPLinkedListImplFactory extends OMLinkedListImplFactory implements SOAPFactory {
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+    /**
+     * Method createSOAPBody
+     *
+     * @param envelope
+     * @return
+     */
+    public SOAPBody createSOAPBody(SOAPEnvelope envelope) {
+        SOAPBody soapBody = new SOAPBodyImpl(envelope);
+        return soapBody;
+    }
+
+    /**
+     * Method createSOAPBody
+     *
+     * @param envelope
+     * @param builder
+     * @return
+     */
+    public SOAPBody createSOAPBody(SOAPEnvelope envelope,
+                                   OMXMLParserWrapper builder) {
+        return new SOAPBodyImpl(envelope, builder);
+    }
+
+    /**
+     * Method createSOAPEnvelope
+     *
+     * @param ns
+     * @param builder
+     * @return
+     */
+    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns,
+                                           OMXMLParserWrapper builder) {
+        return new SOAPEnvelopeImpl(ns, builder);
+    }
+
+    public SOAPEnvelope createSOAPEnvelope() {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    /**
+     * Method createSOAPEnvelope
+     *
+     * @param ns
+     * @return
+     */
+    public SOAPEnvelope createSOAPEnvelope(OMNamespace ns) {
+        return new SOAPEnvelopeImpl(ns);
+    }
+
+       /**
+     * Method createSOAPHeader
+     *
+     * @param envelope
+     * @return
+     */
+    public SOAPHeader createSOAPHeader(SOAPEnvelope envelope) {
+        return new SOAPHeaderImpl(envelope);
+    }
+
+    /**
+     * Method createSOAPHeader
+     *
+     * @param envelope
+     * @param builder
+     * @return
+     */
+    public SOAPHeader createSOAPHeader(SOAPEnvelope envelope,
+                                       OMXMLParserWrapper builder) {
+        return new SOAPHeaderImpl(envelope, builder);
+    }
+
+    /**
+     * Method createSOAPHeaderBlock
+     *
+     * @param localName
+     * @param ns
+     * @return
+     */
+    public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+                                                 OMNamespace ns) {
+        return new SOAPHeaderBlockImpl(localName, ns);
+    }
+
+    /**
+     * Method createSOAPHeaderBlock
+     *
+     * @param localName
+     * @param ns
+     * @param parent
+     * @param builder
+     * @return
+     */
+    public SOAPHeaderBlock createSOAPHeaderBlock(String localName,
+                                                 OMNamespace ns, OMElement parent, OMXMLParserWrapper builder) {
+        return new SOAPHeaderBlockImpl(localName, ns, parent, builder);
+    }
+
+    /**
+     * Method createSOAPFault
+     *
+     * @param parent
+     * @param e
+     * @return
+     */
+    public SOAPFault createSOAPFault(SOAPBody parent, Exception e) {
+        return new SOAPFaultImpl(parent, e);
+    }
+
+    /**
+     * Method createSOAPFault
+     *
+     * @param ns
+     * @param parent
+     * @param builder
+     * @return
+     */
+    public SOAPFault createSOAPFault(OMNamespace ns, SOAPBody parent,
+                                     OMXMLParserWrapper builder) {
+        return new SOAPFaultImpl(ns, parent, builder);
+    }
+
+    /**
+     * Method getDefaultEnvelope
+     *
+     * @return
+     */
+    public SOAPEnvelope getDefaultEnvelope() {
+        // Create an envelope
+        OMNamespace ns =
+        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);
+
+        SOAPHeaderImpl headerImpl = new SOAPHeaderImpl(env);
+        headerImpl.setComplete(true);
+        env.addChild(headerImpl);
+        return env;
+    }
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Constants.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,26 @@
+package org.apache.axis.soap.impl.llom.soap11;
+
+import org.apache.axis.soap.impl.llom.SOAPConstants;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public interface SOAP11Constants extends SOAPConstants{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+   public static final String SOAP_ENVELOPE_NAMESPACE_URI = "http://schemas.xmlsoap.org/soap/envelope/";
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap11/SOAP11Factory.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,26 @@
+package org.apache.axis.soap.impl.llom.soap11;
+
+import org.apache.axis.soap.impl.llom.factory.SOAPLinkedListImplFactory;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public class SOAP11Factory extends SOAPLinkedListImplFactory{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Constants.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,57 @@
+package org.apache.axis.soap.impl.llom.soap12;
+
+import org.apache.axis.soap.impl.llom.SOAPConstants;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public interface SOAP12Constants extends SOAPConstants{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     *
+     */
+
+    public String SOAP_ENVELOPE_NAMESPACE_URI =
+            "http://www.w3.org/2003/05/soap-envelope";
+
+    public static final String SOAP_ROLE = "role";
+    public static final String SOAP_RELAY = "relay";
+
+    // SOAP Fault Code
+    public static final String SOAP_FAULT_CODE_LOCAL_NAME = "Code";
+    public static final String SOAP_FAULT_SUB_CODE_LOCAL_NAME = "SubCode";
+    public static final String SOAP_FAULT_VALUE_LOCAL_NAME = "Value";
+
+    // SOAP Fault Codes
+    public static final String SOAP_FAULT_VALUE_VERSION_MISMATCH = "VersionMismatch";
+    public static final String SOAP_FAULT_VALUE_MUST_UNDERSTAND = "MustUnderstand";
+    public static final String SOAP_FAULT_VALUE_DATA_ENCODING_UKNOWN = "DataEncodingUnknown";
+    public static final String SOAP_FAULT_VALUE_SENDER = "Sender";
+    public static final String SOAP_FAULT_VALUE_RECEIVER = "Receiver";
+
+    // SOAP Fault Reason
+    public static final String SOAP_FAULT_REASON_LOCAL_NAME = "Reason";
+    public static final String SOAP_FAULT_TEXT_LOCAL_NAME = "Text";
+    public static final String SOAP_FAULT_TEXT_LANG_ATTR_LOCAL_NAME = "lang";
+    public static final String SOAP_FAULT_TEXT_LANG_ATTR_NS_URI = "http://www.w3.org/XML/1998/namespace";
+    public static final String SOAP_FAULT_TEXT_LANG_ATTR_NS_PREFIX = "xml";
+
+    // SOAP Fault Node
+    public static final String SOAP_FAULT_NODE_LOCAL_NAME = "Node";
+
+    // SOAP Fault Detail
+    public static final String SOAP_FAULT_DETAIL_LOCAL_NAME = "Detail";
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java?rev=179795&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java (added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/xml_conformance/XMLConformanceTestingProject/src/org/apache/axis/soap/impl/llom/soap12/SOAP12Factory.java Fri Jun  3 07:23:47 2005
@@ -0,0 +1,25 @@
+package org.apache.axis.soap.impl.llom.soap12;
+
+import org.apache.axis.soap.impl.llom.factory.SOAPLinkedListImplFactory;
+
+/**
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * <p/>
+ * Licensed 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ * <p/>
+ */
+public class SOAP12Factory extends SOAPLinkedListImplFactory{
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+}