axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis SOAPPart.java
Date Fri, 16 Jul 2004 16:05:04 GMT
dims        2004/07/16 09:05:04

  Modified:    java/src/org/apache/axis/message MessageElement.java
                        SOAPDocumentImpl.java Text.java
               java/src/org/apache/axis SOAPPart.java
  Log:
  Avoid calling XMLUtils.newDocument() - very expensive
  
  Revision  Changes    Path
  1.177     +10 -2     ws-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.176
  retrieving revision 1.177
  diff -u -r1.176 -r1.177
  --- MessageElement.java	8 Jul 2004 14:13:28 -0000	1.176
  +++ MessageElement.java	16 Jul 2004 16:05:04 -0000	1.177
  @@ -1020,9 +1020,17 @@
        * Text nodes are not supported.
        */
       public SOAPElement addTextNode(String s) throws SOAPException {
  -        org.apache.axis.message.Text text = new org.apache.axis.message.Text(s);
  +        Text text = null;
  +        if (context != null && context.getEnvelope() != null &&
  +                context.getEnvelope().getOwnerDocument() != null) {
  +            Document doc = context.getEnvelope().getOwnerDocument();
  +            text = doc.createTextNode(s);
  +        }
  +        if (text == null) {
  +            text = new org.apache.axis.message.Text(s);
  +        }
           try {
  -            appendChild(text);
  +             appendChild(text);
               return this;
           } catch (ClassCastException e) {
               throw new SOAPException(e);
  
  
  
  1.8       +1 -1      ws-axis/java/src/org/apache/axis/message/SOAPDocumentImpl.java
  
  Index: SOAPDocumentImpl.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPDocumentImpl.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SOAPDocumentImpl.java	27 Jun 2004 12:28:31 -0000	1.7
  +++ SOAPDocumentImpl.java	16 Jul 2004 16:05:04 -0000	1.8
  @@ -162,7 +162,7 @@
        */
       public org.w3c.dom.Text createTextNode(String data) {
           org.apache.axis.message.Text me =
  -            new org.apache.axis.message.Text(data);
  +            new org.apache.axis.message.Text(delegate.createTextNode(data));
           me.setOwnerDocument(soapPart);
           return me;
   
  
  
  
  1.11      +4 -0      ws-axis/java/src/org/apache/axis/message/Text.java
  
  Index: Text.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/Text.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Text.java	27 Jun 2004 12:28:31 -0000	1.10
  +++ Text.java	16 Jul 2004 16:05:04 -0000	1.11
  @@ -29,6 +29,10 @@
    */
   public class Text extends NodeImpl implements javax.xml.soap.Text {
   
  +    public Text(org.w3c.dom.CharacterData data) {
  +        textRep = data;
  +    }
  +
       public Text(String s) {
           try {
               org.w3c.dom.Document doc = org.apache.axis.utils.XMLUtils.newDocument();
  
  
  
  1.73      +1 -1      ws-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/SOAPPart.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- SOAPPart.java	28 Jun 2004 12:52:24 -0000	1.72
  +++ SOAPPart.java	16 Jul 2004 16:05:04 -0000	1.73
  @@ -640,7 +640,7 @@
           DeserializationContext dser = new DeserializationContextImpl(is,
                                              getMessage().getMessageContext(),
                                              getMessage().getMessageType());
  -
  +        dser.getEnvelope().setOwnerDocument(this);
           // This may throw a SAXException
           try {
               dser.parse();
  
  
  

Mime
View raw message