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 Mon, 28 Jun 2004 12:52:24 GMT
dims        2004/06/28 05:52:24

  Modified:    java/test/saaj PackageTests.java
               java/src/org/apache/axis SOAPPart.java
  Added:       java/test/saaj TestDOM.java
  Log:
  Fix for AXIS-1412 - invoking getOwnerDocument on soapenvelope returns null
  
  Revision  Changes    Path
  1.9       +1 -0      ws-axis/java/test/saaj/PackageTests.java
  
  Index: PackageTests.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/saaj/PackageTests.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PackageTests.java	10 Jun 2003 16:27:34 -0000	1.8
  +++ PackageTests.java	28 Jun 2004 12:52:24 -0000	1.9
  @@ -23,6 +23,7 @@
           suite.addTestSuite(test.saaj.TestHeaders.class);
           suite.addTestSuite(test.saaj.TestPrefixes.class);
           suite.addTestSuite(test.saaj.TestSOAPFaults.class);
  +        suite.addTestSuite(test.saaj.TestDOM.class);
           return suite;
       }
   }
  
  
  
  1.1                  ws-axis/java/test/saaj/TestDOM.java
  
  Index: TestDOM.java
  ===================================================================
  package test.saaj;
  
  import javax.xml.soap.MessageFactory;
  import javax.xml.soap.SOAPMessage;
  import javax.xml.soap.SOAPPart;
  
  public class TestDOM extends junit.framework.TestCase {
      public TestDOM(String name) {
          super(name);
      }
  
      public void testOwnerDocument() throws Exception {
          final SOAPMessage message = MessageFactory.newInstance().createMessage();
          SOAPPart soapPart = message.getSOAPPart();
          assertNotNull("envelope should have an owner document",
                  message.getSOAPPart().getEnvelope().getOwnerDocument());
          assertNotNull("soap part must have a document element",
                  soapPart.getDocumentElement());
          assertNotNull(
                  "soap part's document element's owner document should not be null",
                  soapPart.getDocumentElement().getOwnerDocument());
      }
  }
  
  
  
  1.72      +2 -0      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.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- SOAPPart.java	28 Jun 2004 09:46:34 -0000	1.71
  +++ SOAPPart.java	28 Jun 2004 12:52:24 -0000	1.72
  @@ -157,6 +157,7 @@
           int form = FORM_STRING;
           if (initialContents instanceof SOAPEnvelope) {
               form = FORM_SOAPENVELOPE;
  +            ((SOAPEnvelope)initialContents).setOwnerDocument(this);
           } else if (initialContents instanceof InputStream) {
               form = isBodyStream ? FORM_BODYINSTREAM : FORM_INPUTSTREAM;
           } else if (initialContents instanceof byte[]) {
  @@ -619,6 +620,7 @@
               InputStreamBody bodyEl =
                                new InputStreamBody((InputStream)currentMessage);
               SOAPEnvelope env = new SOAPEnvelope();
  +            env.setOwnerDocument(this);
               env.addBodyElement(bodyEl);
               setCurrentForm(env, FORM_SOAPENVELOPE);
               return env;
  
  
  

Mime
View raw message