You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2004/06/28 11:46:34 UTC

cvs commit: ws-axis/java/src/org/apache/axis SOAPPart.java

dims        2004/06/28 02:46:34

  Modified:    java/src/org/apache/axis/message SOAPEnvelope.java
               java/src/org/apache/axis SOAPPart.java
  Log:
  Fix for AXIS-1412 - invoking getOwnerDocument on soapenvelope returns null
  
  Revision  Changes    Path
  1.97      +13 -0     ws-axis/java/src/org/apache/axis/message/SOAPEnvelope.java
  
  Index: SOAPEnvelope.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/message/SOAPEnvelope.java,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- SOAPEnvelope.java	27 Jun 2004 12:28:31 -0000	1.96
  +++ SOAPEnvelope.java	28 Jun 2004 09:46:34 -0000	1.97
  @@ -533,6 +533,7 @@
           if (body == null) {
               body = new SOAPBody(this, soapConstants);
               _isDirty = true;
  +            body.setOwnerDocument((org.apache.axis.SOAPPart) getOwnerDocument());
               return body;
           } else {
               throw new SOAPException(Messages.getMessage("bodyPresent"));
  @@ -547,6 +548,7 @@
       public javax.xml.soap.SOAPHeader addHeader() throws SOAPException {
           if (header == null) {
               header = new SOAPHeader(this, soapConstants);
  +            header.setOwnerDocument((org.apache.axis.SOAPPart) getOwnerDocument());
               return header;
           } else {
               throw new SOAPException(Messages.getMessage("headerPresent"));
  @@ -608,5 +610,16 @@
               body = null;
           }
           return super.removeChild(oldChild);
  +    }
  +
  +
  +    public void setOwnerDocument(org.apache.axis.SOAPPart sp) {
  +        super.setOwnerDocument(sp);
  +        if(body != null) {
  +            body.setOwnerDocument(sp);
  +        }
  +        if(header != null){
  +            header.setOwnerDocument(sp);
  +        }
       }
   }
  
  
  
  1.71      +3 -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.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- SOAPPart.java	17 Jun 2004 21:48:39 -0000	1.70
  +++ SOAPPart.java	28 Jun 2004 09:46:34 -0000	1.71
  @@ -670,7 +670,9 @@
           setCurrentForm(nse, FORM_SOAPENVELOPE);
   
           log.debug("Exit: SOAPPart::getAsSOAPEnvelope");
  -        return (SOAPEnvelope)currentMessage;
  +        SOAPEnvelope env = (SOAPEnvelope)currentMessage;
  +        env.setOwnerDocument(this);
  +        return env;
       }
   
       /**