sandholm    2002/12/12 04:47:55

  Modified:    java/src/org/apache/axis/message SOAPBody.java
               java/src/org/apache/axis/utils NSStack.java
  Log:
  added hook to disable prettty formatting of SOAPBody (useful when signing bodies 
passed through a router) + minor bug fix (Null pointer) to NSStack
  
  Revision  Changes    Path
  1.38      +11 -1     xml-axis/java/src/org/apache/axis/message/SOAPBody.java
  
  Index: SOAPBody.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPBody.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- SOAPBody.java     11 Dec 2002 22:38:20 -0000      1.37
  +++ SOAPBody.java     12 Dec 2002 12:47:54 -0000      1.38
  @@ -86,6 +86,8 @@
   
       private SOAPConstants soapConstants;
   
  +    private boolean disableFormatting = false;
  +
       SOAPBody(SOAPEnvelope env, SOAPConstants soapConsts) {
           soapConstants = soapConsts;
           try {
  @@ -118,10 +120,18 @@
           ((SOAPEnvelope)parent).removeBody();
           super.detachNode();
       }
  +   
  +    public void disableFormatting() {
  +        this.disableFormatting = true;
  +    }
   
       protected void outputImpl(SerializationContext context) throws Exception {
           boolean oldPretty = context.getPretty();
  -        context.setPretty(true);
  +        if (!disableFormatting) {
  +             context.setPretty(true);
  +        } else {
  +             context.setPretty(false);
  +        }
   
           if (bodyElements.isEmpty()) {
               // This is a problem.
  
  
  
  1.37      +1 -1      xml-axis/java/src/org/apache/axis/utils/NSStack.java
  
  Index: NSStack.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/NSStack.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- NSStack.java      11 Dec 2002 17:17:45 -0000      1.36
  +++ NSStack.java      12 Dec 2002 12:47:55 -0000      1.37
  @@ -241,7 +241,7 @@
   
           // If defaults are OK, and the given NS is the current default,
           // return "" as the prefix to favor defaults where possible.
  -        if (!noDefault && currentDefaultNS > 0 && 
  +        if (!noDefault && currentDefaultNS > 0 && stack[currentDefaultNS] != null &&
                   namespaceURI.equals(
                           stack[currentDefaultNS].getNamespaceURI()))
               return "";
  
  
  


Reply via email to