axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject cvs commit: xml-axis/java/test/encoding TestDOM.java
Date Thu, 09 Aug 2001 20:10:35 GMT
rubys       01/08/09 13:10:35

  Added:       java/test/encoding TestDOM.java
  Log:
  Test case (not currently working) to verify that transformations from
  String => SOAPEnvelope => String don't modify the results.
  
  Revision  Changes    Path
  1.1                  xml-axis/java/test/encoding/TestDOM.java
  
  Index: TestDOM.java
  ===================================================================
  package test.encoding;
  
  import org.apache.axis.*;
  import org.apache.axis.encoding.*;
  import org.apache.axis.handlers.soap.*;
  import org.apache.axis.message.*;
  import org.apache.axis.registries.*;
  import org.apache.axis.server.AxisServer;
  import org.apache.axis.utils.QName;
  import org.xml.sax.InputSource;
  import java.io.*;
  import java.util.*;
  
  import junit.framework.TestCase;
  
  /** 
   * Verify that deserialization actually can cause the soap service
   * to be set...
   */
  public class TestDOM extends TestCase {
  
      public TestDOM(String name) {
          super(name);
      }
  
      private String request =
          "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
          "<SOAP-ENV:Envelope" +
          " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" +
          " xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
          " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" +
          " SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" +
          "  <SOAP-ENV:Header>x\n" +
          "    <SOAP-SEC:signature SOAP-ENV:actor=\"null\" SOAP-ENV:mustUnderstand=\"1\"\n"
+
          "     xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
          "     xmlns:SOAP-SEC=\"http://schemas.xmlsoap.org/soap/security/\">\n" +
          "       <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\n" +
          "       </Signature>\n" +
          "    </SOAP-SEC:signature>\n" +
          "  </SOAP-ENV:Header>\n" +
          "  <SOAP-ENV:Body id=\"body\">\n" +
          "    <ns1:getQuote xmlns:ns1=\"urn:xmltoday-delayed-quotes\">\n" +
          "      <symbol xsi:type=\"xsd:string\">IBM</symbol>\n" +
          "    </ns1:getQuote>\n" +
          "  </SOAP-ENV:Body>\n" +
          "</SOAP-ENV:Envelope>";
  
      public void testDOM() throws Exception {
  
         // setup
         AxisEngine engine = new AxisServer();
         engine.init();
         MessageContext msgContext = new MessageContext(engine);
         Message message = new Message(request);
         message.setMessageContext(msgContext);
  
         // Now completely round trip it
         SOAPEnvelope envelope = message.getAsSOAPEnvelope();
         // Element dom = message.getAsDOM();
         String result = message.getAsString();
  
         assertEquals(request, result);
      }
  
      public static void main(String[] args) throws Exception {
          new TestDOM("main").testDOM();
      }
  }
  
  
  

Mime
View raw message