butek       02/04/21 12:09:28

  Modified:    java/samples/encoding readme
               java/test/functional TestElementSample.java
  Added:       java/samples/encoding TestElem.java
  Log:
  One of the encoding samples was named testElement.  Since it's a class, it
  should be named TestElement (with a capital T).  In a previous commit I
  removed testElement.  In this commit I WANTED to add TestElement, but
  CVS complained at me:
  
  assertion "key != NULL" failed: file 
"/usr/src/gnu/usr.bin/cvs/cvs/../../../../contrib/cvs/src/hash.c", line 312
  cvs [server aborted]: received abort signal
  
  Since I suspect CVS is having problems distinguishing files that differ
  only by case, I'm simply changing the name of this sample to TestElem so it
  doesn't clash with the old testElement.
  
  Revision  Changes    Path
  1.2       +2 -2      xml-axis/java/samples/encoding/readme
  
  Index: readme
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/encoding/readme,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- readme    21 Apr 2002 14:38:35 -0000      1.1
  +++ readme    21 Apr 2002 19:09:28 -0000      1.2
  @@ -20,8 +20,8 @@
   
   4.  Run the samples.
       Finally, to run the clients, run:
  -        java samples.encoding.TestElement
  +        java samples.encoding.TestElem
        java samples.encoding.TestSer
   
  -Note:  Only TestElement needs the server and the deploy step.  TestSer can
  +Note:  Only TestElem needs the server and the deploy step.  TestSer can
          run without those steps.
  
  
  
  1.1                  xml-axis/java/samples/encoding/TestElem.java
  
  Index: TestElem.java
  ===================================================================
  package samples.encoding;
  
  /*
  import org.apache.axis.client.* ;
  import org.apache.axis.utils.* ;
  */
  import java.io.ByteArrayInputStream;
  
  import java.net.URL;
  
  import javax.xml.rpc.namespace.QName;
  
  import org.apache.axis.client.Call;
  import org.apache.axis.client.Service;
  
  import org.apache.axis.utils.Options;
  import org.apache.axis.utils.XMLUtils;
  
  import org.w3c.dom.Element;
  
  public class TestElem {
      static String xml = "<x:hello xmlns:x=\"urn:foo\">a string</x:hello>" ;
  
      public static String doit(String[] args,String xml) throws Exception {
          ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
  
          String  sURL = "http://localhost:8080/axis/services/ElementService"; ;
          QName   sqn  = new QName(sURL, "ElementServiceService" );
          QName   pqn  = new QName(sURL, "ElementService" );
  
          //Service service=new Service(new URL("file:ElementService.wsdl"),sqn);
          Service service = new Service(new URL(sURL+"?wsdl"),sqn);
          Call    call    = (Call) service.createCall( pqn, "echoElement" );
  
          Options opts = new Options(args);
          opts.setDefaultURL( call.getTargetEndpointAddress() );
          call.setTargetEndpointAddress( new URL(opts.getURL()) );
  
          Element elem = XMLUtils.newDocument(bais).getDocumentElement();
  
          elem = (Element) call.invoke( new Object[] { "a string", elem } );
          return( XMLUtils.ElementToString( elem ) );
      }
  
      public static void main(String[] args) throws Exception {
          System.out.println("Sent: " + xml );
          String res = doit(args, xml);
          System.out.println("Returned: " + res );
      }
  }
  
  
  
  1.3       +2 -2      xml-axis/java/test/functional/TestElementSample.java
  
  Index: TestElementSample.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/functional/TestElementSample.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestElementSample.java    19 Feb 2002 17:38:22 -0000      1.2
  +++ TestElementSample.java    21 Apr 2002 19:09:28 -0000      1.3
  @@ -60,7 +60,7 @@
   import org.apache.axis.client.AdminClient;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -import samples.encoding.testElement;
  +import samples.encoding.TestElem;
   
   /** Test the ElementService sample code.
    */
  @@ -76,7 +76,7 @@
           String[] args = {};
           String   xml = "<x:hello xmlns:x=\"urn:foo\">a string</x:hello>";
           System.out.println("Sending : " + xml );
  -        String res = new testElement().doit(args, xml);
  +        String res = new TestElem().doit(args, xml);
           System.out.println("Received: " + res );
           assertEquals("TestElementSample.doit(): xml must match", res, xml);
       }
  
  
  


Reply via email to