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 ru...@apache.org on 2001/09/02 18:48:05 UTC

cvs commit: xml-axis/java/src/org/apache/axis/message SOAPEnvelope.java

rubys       01/09/02 09:48:04

  Modified:    java/src/org/apache/axis/encoding SerializationContext.java
               java/src/org/apache/axis/message SOAPEnvelope.java
  Log:
  Pretty print dirty envelopes.  This is intentionally very targettted -
  if somebody passes us a message in string, stream, DOM or other formats,
  it will processed verbatim.
  
  Revision  Changes    Path
  1.36      +15 -1     xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java
  
  Index: SerializationContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContext.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- SerializationContext.java	2001/08/22 22:55:10	1.35
  +++ SerializationContext.java	2001/09/02 16:48:04	1.36
  @@ -78,7 +78,6 @@
   public class SerializationContext
   {
       private static final boolean DEBUG_LOG = false;
  -    private static final boolean pretty = false;
       
       public NSStack nsStack = new NSStack();
                                           
  @@ -94,6 +93,21 @@
       
       private MessageContext msgContext;
       
  +    /**
  +     * Should the XML be "pretty" printed on serialization?  If false, the
  +     * XML will be sent out verbatim.  If true, ignorable white space may be 
  +     * inserted or removed.
  +     */
  +    private boolean pretty = false;
  +
  +    public boolean getPretty() {
  +        return pretty;
  +    }
  +
  +    public void setPretty(boolean pretty) {
  +        this.pretty = pretty;
  +    }
  +
       /**
        * Should I write out objects as multi-refs?
        *
  
  
  
  1.35      +5 -0      xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
  
  Index: SOAPEnvelope.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- SOAPEnvelope.java	2001/08/14 13:10:32	1.34
  +++ SOAPEnvelope.java	2001/09/02 16:48:04	1.35
  @@ -261,6 +261,9 @@
       public void outputImpl(SerializationContext context)
           throws Exception
       {
  +        boolean oldPretty = context.getPretty();
  +        context.setPretty(true);
  +
           // Register namespace prefixes.
           if (namespaces != null) {
               for (Iterator i = namespaces.iterator(); i.hasNext(); ) {
  @@ -331,5 +334,7 @@
           
           // Output </SOAP-ENV:Envelope>
           context.endElement();
  +
  +        context.setPretty(oldPretty);
       }
   }