axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r358204 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/context/ConfigurationContext.java xml/src/org/apache/axis2/soap/SOAPFactory.java xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
Date Wed, 21 Dec 2005 04:43:02 GMT
Author: chinthaka
Date: Tue Dec 20 20:42:30 2005
New Revision: 358204

URL: http://svn.apache.org/viewcvs?rev=358204&view=rev
Log:
Fixing a small bug in SOAPEnvelopeImpl

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFactory.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java?rev=358204&r1=358203&r2=358204&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/ConfigurationContext.java
Tue Dec 20 20:42:30 2005
@@ -50,7 +50,6 @@
     public ConfigurationContext(AxisConfiguration axisConfiguration) {
         super(null);
         this.axisConfiguration = axisConfiguration;
-        startTimerTaskToTimeOutSGCtxt();
     }
 
     private void startTimerTaskToTimeOutSGCtxt() {

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFactory.java?rev=358204&r1=358203&r2=358204&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFactory.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/SOAPFactory.java Tue
Dec 20 20:42:30 2005
@@ -322,4 +322,5 @@
     public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException;
 
     public SOAPEnvelope getDefaultFaultEnvelope() throws SOAPProcessingException;
+    
 }

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java?rev=358204&r1=358203&r2=358204&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
Tue Dec 20 20:42:30 2005
@@ -16,6 +16,7 @@
 
 package org.apache.axis2.soap.impl.llom;
 
+import org.apache.axis2.om.OMAbstractFactory;
 import org.apache.axis2.om.OMConstants;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMException;
@@ -23,14 +24,8 @@
 import org.apache.axis2.om.OMNode;
 import org.apache.axis2.om.OMXMLParserWrapper;
 import org.apache.axis2.om.impl.OMOutputImpl;
-import org.apache.axis2.soap.SOAP12Constants;
-import org.apache.axis2.soap.SOAPBody;
-import org.apache.axis2.soap.SOAPConstants;
-import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.soap.SOAPFactory;
-import org.apache.axis2.soap.SOAPHeader;
-import org.apache.axis2.soap.SOAPHeaderBlock;
-import org.apache.axis2.soap.SOAPProcessingException;
+import org.apache.axis2.soap.*;
+import org.apache.axis2.soap.impl.llom.factory.SOAPLinkedListImplFactory;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -73,15 +68,26 @@
      */
     public SOAPHeader getHeader() throws OMException {
         SOAPHeader header =
-                (SOAPHeader)getFirstChildWithName(
+                (SOAPHeader) getFirstChildWithName(
                         new QName(SOAPConstants.HEADER_LOCAL_NAME));
         if (builder == null && header == null) {
+            inferFactory();
             header = factory.createSOAPHeader(this);
             addChild(header);
         }
         return header;
     }
 
+    private void inferFactory() {
+        if (factory instanceof SOAPLinkedListImplFactory && ns != null) {
+            if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(ns.getName())) {
+                factory = OMAbstractFactory.getSOAP12Factory();
+            } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(ns.getName()))
{
+                factory = OMAbstractFactory.getSOAP11Factory();
+            }
+        }
+    }
+
     /**
      * Convenience method to add a SOAP header to this envelope
      *
@@ -92,13 +98,16 @@
             throws OMException {
         // TODO : cache SOAP header and body instead of looking them up?
 
+
         OMNamespace namespace = factory.createOMNamespace(namespaceURI, null);
         return this.addHeaderBlock(name, namespace);
     }
 
     public SOAPHeaderBlock addHeaderBlock(String name, OMNamespace namespace) throws OMException
{
         SOAPHeader headerContainer = getHeader();
-        return factory.createSOAPHeaderBlock(name,namespace,headerContainer);
+        inferFactory();
+        
+        return factory.createSOAPHeaderBlock(name, namespace, headerContainer);
     }
 
     public void addChild(OMNode child) {



Mime
View raw message