axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r376203 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java doom/src/org/apache/axis2/soap/impl/dom/SOAPFaultImpl.java
Date Thu, 09 Feb 2006 06:18:51 GMT
Author: chinthaka
Date: Wed Feb  8 22:18:49 2006
New Revision: 376203

URL: http://svn.apache.org/viewcvs?rev=376203&view=rev
Log:
- Fixing a possible NPE in AddressingOut
- We were adding SOAP namespace for the exception element of Fault. Removing that too. I did
this change to om separately. Now doing this for DOOM as well.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
    webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/SOAPFaultImpl.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java?rev=376203&r1=376202&r2=376203&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingOutHandler.java
Wed Feb  8 22:18:49 2006
@@ -28,16 +28,16 @@
 import org.apache.ws.commons.om.OMAbstractFactory;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMNamespace;
-import org.apache.ws.commons.om.OMNode;
 import org.apache.ws.commons.soap.SOAPEnvelope;
+import org.apache.ws.commons.soap.SOAPFactory;
 import org.apache.ws.commons.soap.SOAPHeader;
 import org.apache.ws.commons.soap.SOAPHeaderBlock;
 import org.apache.wsdl.WSDLConstants;
 
 import javax.xml.namespace.QName;
+import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.ArrayList;
 
 public class AddressingOutHandler extends AddressingHandler {
 
@@ -88,6 +88,10 @@
         Options messageContextOptions = msgContext.getOptions();
         SOAPEnvelope envelope = msgContext.getEnvelope();
         SOAPHeader soapHeader = envelope.getHeader();
+        if (soapHeader == null) {
+            SOAPFactory soapFac = msgContext.isSOAP11() ? OMAbstractFactory.getSOAP11Factory()
: OMAbstractFactory.getSOAP12Factory();
+            soapHeader = soapFac.createSOAPHeader(envelope);
+        }
 
         // by this time, we definitely have some addressing information to be sent. This
is because,
         // we have tested at the start of this whether messageInformationHeaders are null
or not.
@@ -239,7 +243,7 @@
         // add epr address
         String address = epr.getAddress();
         if (!"".equals(address) && address != null) {
-            OMElement addressElement = OMAbstractFactory.getOMFactory().createOMElement(EPR_ADDRESS,addressingNamespaceObject,
soapHeaderBlock);
+            OMElement addressElement = OMAbstractFactory.getOMFactory().createOMElement(EPR_ADDRESS,
addressingNamespaceObject, soapHeaderBlock);
             addressElement.setText(address);
         }
 

Modified: webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/SOAPFaultImpl.java?rev=376203&r1=376202&r2=376203&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/SOAPFaultImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/doom/src/org/apache/axis2/soap/impl/dom/SOAPFaultImpl.java
Wed Feb  8 22:18:49 2006
@@ -16,15 +16,14 @@
 
 package org.apache.axis2.soap.impl.dom;
 
+import org.apache.axis2.om.impl.dom.ElementImpl;
+import org.apache.axis2.om.impl.dom.ParentNode;
 import org.apache.ws.commons.om.OMConstants;
 import org.apache.ws.commons.om.OMElement;
 import org.apache.ws.commons.om.OMException;
 import org.apache.ws.commons.om.OMNode;
 import org.apache.ws.commons.om.OMXMLParserWrapper;
 import org.apache.ws.commons.om.impl.OMNodeEx;
-import org.apache.axis2.om.impl.dom.ElementImpl;
-import org.apache.axis2.om.impl.dom.NamespaceImpl;
-import org.apache.axis2.om.impl.dom.ParentNode;
 import org.apache.ws.commons.om.impl.llom.OMSerializerUtil;
 import org.apache.ws.commons.om.impl.llom.serialize.StreamWriterToContentHandlerConverter;
 import org.apache.ws.commons.soap.SOAP12Constants;
@@ -161,7 +160,7 @@
 		}
 		OMElement faultDetailEnty = new ElementImpl((ParentNode) this,
 				SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY,
-				(NamespaceImpl) this.namespace);
+				null);
 		faultDetailEnty.setText(sw.getBuffer().toString());
 	}
 



Mime
View raw message