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 Νίκος Γεωργίου <ng...@dblab.ece.ntua.gr> on 2006/02/02 10:03:03 UTC

axis1.3 SOAPFaultBuilder.java problem fixed

I had a problem dealing with fault responses and I got it fixed.
The problem was in SOAPFaultBuilder.java

the message node was added to a new DOM Document but it was NOT imported 
first!
Importing the node first into the new DOM Document solved the problem.


The diff -u output is:

--- 
ws-axis-java-original/src/org/apache/axis/message/SOAPFaultBuilder.java    
2005-07-27 06:44:02.000000000 +0300
+++ 
ws-axis-java-patched/src/org/apache/axis/message/SOAPFaultBuilder.java    
2006-01-31 17:56:27.640439500 +0200
@@ -24,6 +24,7 @@
 import org.apache.axis.soap.SOAPConstants;
 import org.apache.axis.utils.Messages;
 import org.apache.axis.utils.XMLUtils;
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.xml.sax.Attributes;
@@ -301,8 +302,9 @@
                         if (node instanceof MessageElement) {
                             elements[i] = ((MessageElement) 
node).getAsDOM();
                         } else if(node instanceof Text){
-                            elements[i] = 
XMLUtils.newDocument().createElement("text");
-                            elements[i].appendChild(node);
+                Document tempDoc = XMLUtils.newDocument();
+                            elements[i] = tempDoc.createElement("text");
+                            
elements[i].appendChild(tempDoc.importNode(node,true));
                         }
                     } catch (Exception e) {
                         throw new SAXException(e);



Re: axis1.3 SOAPFaultBuilder.java problem fixed

Posted by Νίκος Γεωργίου <ng...@dblab.ece.ntua.gr>.
Davanum Srinivas wrote:

>Can you please create a new JIRA bug and upload this patch?
>
>  
>

okay, I just did it!

http://issues.apache.org/jira/browse/AXIS-2394

I hope I did it properly... :-|


Re: axis1.3 SOAPFaultBuilder.java problem fixed

Posted by Davanum Srinivas <da...@gmail.com>.
Can you please create a new JIRA bug and upload this patch?

thanks,
dims

On 2/2/06, Νίκος Γεωργίου <ng...@dblab.ece.ntua.gr> wrote:
> I had a problem dealing with fault responses and I got it fixed.
> The problem was in SOAPFaultBuilder.java
>
> the message node was added to a new DOM Document but it was NOT imported
> first!
> Importing the node first into the new DOM Document solved the problem.
>
>
> The diff -u output is:
>
> ---
> ws-axis-java-original/src/org/apache/axis/message/SOAPFaultBuilder.java
> 2005-07-27 06:44:02.000000000 +0300
> +++
> ws-axis-java-patched/src/org/apache/axis/message/SOAPFaultBuilder.java
> 2006-01-31 17:56:27.640439500 +0200
> @@ -24,6 +24,7 @@
>  import org.apache.axis.soap.SOAPConstants;
>  import org.apache.axis.utils.Messages;
>  import org.apache.axis.utils.XMLUtils;
> +import org.w3c.dom.Document;
>  import org.w3c.dom.Element;
>  import org.w3c.dom.Node;
>  import org.xml.sax.Attributes;
> @@ -301,8 +302,9 @@
>                          if (node instanceof MessageElement) {
>                              elements[i] = ((MessageElement)
> node).getAsDOM();
>                          } else if(node instanceof Text){
> -                            elements[i] =
> XMLUtils.newDocument().createElement("text");
> -                            elements[i].appendChild(node);
> +                Document tempDoc = XMLUtils.newDocument();
> +                            elements[i] = tempDoc.createElement("text");
> +
> elements[i].appendChild(tempDoc.importNode(node,true));
>                          }
>                      } catch (Exception e) {
>                          throw new SAXException(e);
>
>
>


--
Davanum Srinivas : http://wso2.com/blogs/