axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis/message SOAPHandler.java
Date Mon, 15 Nov 2004 19:03:01 GMT
gawor       2004/11/15 11:03:01

  Modified:    java/src/org/apache/axis/message SOAPHandler.java
  Log:
  apparently this was needed :)
  
  Revision  Changes    Path
  1.19      +21 -1     ws-axis/java/src/org/apache/axis/message/SOAPHandler.java
  
  Index: SOAPHandler.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPHandler.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- SOAPHandler.java	15 Nov 2004 05:33:22 -0000	1.18
  +++ SOAPHandler.java	15 Nov 2004 19:03:01 -0000	1.19
  @@ -32,6 +32,7 @@
   import org.xml.sax.helpers.DefaultHandler;
   
   import javax.xml.soap.SOAPException;
  +import java.io.CharArrayWriter;
   
   public class SOAPHandler extends DefaultHandler
   {
  @@ -39,6 +40,8 @@
       private MessageElement[] myElements;
       private int myIndex = 0;
   
  +    private CharArrayWriter val;
  +    
       public SOAPHandler() {
       }
   
  @@ -106,6 +109,19 @@
           throws SAXException
       {
           if (myElement != null) {
  +
  +            if (val != null && val.size() > 0) {
  +                String s = StringUtils.strip(val.toString());
  +                val.reset();
  +                if(s.length()>0){
  +                    try {
  +                        myElement.addTextNode(s);
  +                    } catch (SOAPException e) {
  +                        throw new SAXException(e);
  +                    }
  +                }
  +            }
  +
               if (myElements != null) {
                   myElements[myIndex] = myElement;
               }
  @@ -131,7 +147,11 @@
       }
   
       public void characters(char[] chars, int start, int end) 
  -        throws SAXException
  +        throws SAXException 
       {
  +        if (val == null) {
  +            val = new CharArrayWriter();
  +        }
  +        val.write(chars, start, end);
       }
   }
  
  
  

Mime
View raw message