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 gd...@apache.org on 2002/01/14 20:45:06 UTC

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

gdaniels    02/01/14 11:45:06

  Modified:    java/src/org/apache/axis/message SOAPHeader.java
  Log:
  Fix logic for maintaining MustUnderstand attribute in sync with local value,
  and add logic to do the same for the actor attribute.
  
  Revision  Changes    Path
  1.30      +24 -3     xml-axis/java/src/org/apache/axis/message/SOAPHeader.java
  
  Index: SOAPHeader.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/SOAPHeader.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- SOAPHeader.java	30 Oct 2001 14:19:29 -0000	1.29
  +++ SOAPHeader.java	14 Jan 2002 19:45:06 -0000	1.30
  @@ -127,18 +127,39 @@
               if (idx > -1) {
                   // Got it, so replace it's value.
                   attributes.setValue(idx, b ? "1" : "0");
  +                return;
               }
           } else {
               attributes = new AttributesImpl();
  -            addAttribute(Constants.URI_SOAP_ENV,
  -                         Constants.ATTR_MUST_UNDERSTAND,
  -                         b ? "1" : "0");
           }
  +        
  +        addAttribute(Constants.URI_SOAP_ENV,
  +                     Constants.ATTR_MUST_UNDERSTAND,
  +                     b ? "1" : "0");
       }
   
       public String getActor() { return( actor ); }
       public void setActor(String a) {
           actor = a ;
  +        if (attributes != null) {
  +            int idx = attributes.getIndex(Constants.URI_SOAP_ENV,
  +                                          Constants.ATTR_ACTOR);
  +            if (idx > -1) {
  +                // Got it, so replace it's value.
  +                if (a != null) {
  +                    attributes.setValue(idx, a);
  +                } else {
  +                    attributes.removeAttribute(idx);
  +                }
  +                return;
  +            }
  +        } else if (a != null) {
  +            attributes = new AttributesImpl();
  +        }
  +
  +        addAttribute(Constants.URI_SOAP_ENV,
  +                     Constants.ATTR_ACTOR,
  +                     a);
       }
   
       public void setProcessed(boolean value) {