You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ch...@apache.org on 2006/02/14 16:40:41 UTC

svn commit: r377747 - in /webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom: SOAPFaultImpl.java soap11/SOAP11FaultDetailImpl.java

Author: chinthaka
Date: Tue Feb 14 07:40:40 2006
New Revision: 377747

URL: http://svn.apache.org/viewcvs?rev=377747&view=rev
Log:
Improving SOAPFault detail to serialize more than one child

Modified:
    webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/SOAPFaultImpl.java
    webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java

Modified: webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/SOAPFaultImpl.java?rev=377747&r1=377746&r2=377747&view=diff
==============================================================================
--- webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/SOAPFaultImpl.java (original)
+++ webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/SOAPFaultImpl.java Tue Feb 14 07:40:40 2006
@@ -159,16 +159,13 @@
         StringWriter sw = new StringWriter();
         e.printStackTrace(new PrintWriter(sw));
         sw.flush();
-        getDetail();
+        SOAPFaultDetail detail = getDetail();
         if (getDetail() == null) {
-            setDetail(getNewSOAPFaultDetail(this));
-
+            detail = getNewSOAPFaultDetail(this);
+            setDetail(detail);
         }
-        OMElement faultDetailEnty = new OMElementImpl(
-                SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY,
-                null);
+        OMElement faultDetailEnty = new OMElementImpl(SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY,null, detail);
         faultDetailEnty.setText(sw.getBuffer().toString());
-        getDetail().addChild(faultDetailEnty);
     }
 
     protected void setNewElement(OMElement myElement, OMElement newElement) {

Modified: webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java
URL: http://svn.apache.org/viewcvs/webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java?rev=377747&r1=377746&r2=377747&view=diff
==============================================================================
--- webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java (original)
+++ webservices/commons/modules/axiom/src/org/apache/ws/commons/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java Tue Feb 14 07:40:40 2006
@@ -17,8 +17,9 @@
 package org.apache.ws.commons.soap.impl.llom.soap11;
 
 import org.apache.ws.commons.om.OMElement;
+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.ws.commons.om.impl.llom.OMNodeImpl;
 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.SOAP11Constants;
@@ -79,10 +80,12 @@
         String text = this.getText();
         writer.writeCharacters(text);
 
-
-        if (firstChild != null) {
-            ((OMNodeEx)firstChild).serializeAndConsume(omOutput);
+        OMNode child = (OMNodeImpl) firstChild;
+        while (child != null && ((!(child instanceof OMElement)) || child.isComplete())) {
+           ((OMNodeImpl) child).serializeAndConsume(omOutput);
+            child = child.getNextOMSibling();
         }
+
         writer.writeEndElement();
     }