axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/test/encoding TestArrayListConversions.java
Date Sun, 21 Oct 2001 00:52:16 GMT
dug         01/10/20 17:52:16

  Modified:    java/samples/bidbuy v3.java
               java/samples/echo TestClient.java
               java/src/org/apache/axis AxisEngine.java
               java/test put.java
               java/test/encoding TestArrayListConversions.java
  Log:
  Remove last of ServiceClient uses.
  
  Revision  Changes    Path
  1.13      +0 -1      xml-axis/java/samples/bidbuy/v3.java
  
  Index: v3.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/bidbuy/v3.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- v3.java	2001/10/19 01:36:50	1.12
  +++ v3.java	2001/10/21 00:52:16	1.13
  @@ -4,7 +4,6 @@
   import org.apache.axis.client.Call;
   import org.apache.axis.encoding.BeanSerializer;
   import org.apache.axis.encoding.SOAPTypeMappingRegistry;
  -import org.apache.axis.encoding.ServiceDescription;
   import org.apache.axis.message.RPCElement;
   import org.apache.axis.message.RPCParam;
   import org.apache.axis.transport.http.HTTPTransport;
  
  
  
  1.36      +0 -1      xml-axis/java/samples/echo/TestClient.java
  
  Index: TestClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/echo/TestClient.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- TestClient.java	2001/10/19 02:11:39	1.35
  +++ TestClient.java	2001/10/21 00:52:16	1.36
  @@ -59,7 +59,6 @@
   import org.apache.axis.client.Call;
   import org.apache.axis.client.Service;
   import org.apache.axis.encoding.BeanSerializer;
  -import org.apache.axis.encoding.ServiceDescription;
   import org.apache.axis.encoding.TypeMappingRegistry;
   import org.apache.axis.message.RPCParam;
   import org.apache.axis.transport.http.HTTPTransport;
  
  
  
  1.38      +3 -3      xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- AxisEngine.java	2001/10/18 18:02:11	1.37
  +++ AxisEngine.java	2001/10/21 00:52:16	1.38
  @@ -270,10 +270,10 @@
        * Client engine access
        *
        * An AxisEngine may define another specific AxisEngine to be used
  -     * by newly created ServiceClients.  For instance, a server may
  +     * by newly created Clients.  For instance, a server may
        * create an AxisClient and allow deployment to it.  Then
  -     * the server's services may create ServiceClient objects which
  -     * can access the AxisClient's deployed handlers and transports.
  +     * the server's services may access the AxisClient's deployed 
  +     * handlers and transports.
        *********************************************************************
        */
   
  
  
  
  1.6       +11 -7     xml-axis/java/test/put.java
  
  Index: put.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/put.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- put.java	2001/10/18 13:28:37	1.5
  +++ put.java	2001/10/21 00:52:16	1.6
  @@ -2,7 +2,8 @@
   
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.client.ServiceClient;
  +import org.apache.axis.client.Call;
  +import org.apache.axis.client.Service;
   import org.apache.axis.transport.http.HTTPTransport;
   import org.apache.axis.utils.Options;
   
  @@ -22,18 +23,21 @@
           Options opts = new Options(args);
           String action = opts.isValueSet('a');
   
  -        ServiceClient sc = new ServiceClient(opts.getURL());
  -        if (action != null) sc.set(HTTPTransport.ACTION, action);
  +        Service  service = new Service();
  +        Call     call    = (Call) service.createCall();
  +
  +        call.setTargetEndpointAddress( new java.net.URL(opts.getURL()) );
  +        if (action != null )
  +            call.setProperty( HTTPTransport.ACTION, action );
     
           args = opts.getRemainingArgs();
           for (int i=0; i<args.length; i++) {
               FileInputStream stream = new FileInputStream(new File(args[i]));
  -            sc.setRequestMessage(new Message(stream));
  +            call.setRequestMessage(new Message(stream));
       
  -            sc.invoke();
  +            call.invoke();
           
  -            MessageContext mc = sc.getMessageContext();
  -            System.out.println(mc.getResponseMessage().getAsString());
  +            System.out.println(call.getResponseMessage().getAsString());
           }
       }
   }
  
  
  
  1.8       +31 -19    xml-axis/java/test/encoding/TestArrayListConversions.java
  
  Index: TestArrayListConversions.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestArrayListConversions.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestArrayListConversions.java	2001/10/18 13:28:38	1.7
  +++ TestArrayListConversions.java	2001/10/21 00:52:16	1.8
  @@ -2,7 +2,9 @@
   
   import junit.framework.TestCase;
   import org.apache.axis.Handler;
  -import org.apache.axis.client.ServiceClient;
  +import org.apache.axis.client.Call;
  +import org.apache.axis.client.Service;
  +import org.apache.axis.encoding.XMLType;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.registries.HandlerRegistry;
   import org.apache.axis.server.AxisServer;
  @@ -16,7 +18,7 @@
   public class TestArrayListConversions extends TestCase {
     private static final String SERVICE_NAME = "TestArrayConversions";
     
  -  private ServiceClient client;
  +  private Call call;
     
     public TestArrayListConversions()
     {
  @@ -50,17 +52,24 @@
   
     public void init()
     {
  -    ServiceClient.initialize();
  -    AxisServer server = new AxisServer();
  -    HandlerRegistry hr = (HandlerRegistry) server.getHandlerRegistry();
  -    Handler disp = hr.find("RPCDispatcher");    
  -    SOAPService service = new SOAPService(disp);
  -    service.addOption("className", "test.encoding.TestArrayListConversions");
  -    service.addOption("methodName", "*");
  -    
  -    server.deployService(SERVICE_NAME, service);
  -    
  -    client = new ServiceClient(new LocalTransport(server));
  +    try {
  +      Service ss = new Service();
  +      AxisServer server = new AxisServer();
  +      HandlerRegistry hr = (HandlerRegistry) server.getHandlerRegistry();
  +      Handler disp = hr.find("RPCDispatcher");    
  +      SOAPService service = new SOAPService(disp);
  +      service.addOption("className", "test.encoding.TestArrayListConversions");
  +      service.addOption("methodName", "*");
  +      
  +      server.deployService(SERVICE_NAME, service);
  +      
  +      call = (Call) ss.createCall();
  +      call.setTransport( new LocalTransport(server) );
  +    }
  +    catch( Exception exp ) {
  +      exp.printStackTrace();
  +    }
  +
     }
     
     public void testVectorConversion() throws Exception
  @@ -68,8 +77,9 @@
       Vector v = new Vector();
       v.addElement("Hi there!");
       v.addElement("This'll be a SOAP Array and then a LinkedList!");
  -    Object ret = client.invoke(SERVICE_NAME, "echoLinkedList",
  -                               new Object [] { v });
  +    call.setOperationName( "echoLinkedList" );
  +    call.setProperty( Call.NAMESPACE, SERVICE_NAME );
  +    Object ret = call.invoke( new Object[] { v } );
       if (!equals(v, ret)) assertEquals("Echo LinkedList mangled the result.  Result is underneath.\n"
+ ret, v, ret);
     }
     
  @@ -80,8 +90,9 @@
       l.add("Second linked list item");
       l.add("This will be a SOAP Array then a Vector!");
   
  -    Object ret = client.invoke(SERVICE_NAME, "echoVector",
  -                        new Object [] { l });
  +    call.setOperationName( "echoVector" );
  +    call.setProperty( Call.NAMESPACE, SERVICE_NAME );
  +    Object ret = call.invoke( new Object[] { l } );
       if (!equals(l, ret)) assertEquals("Echo Vector mangled the result.  Result is underneath.\n"
+ ret, l, ret);
     }
         
  @@ -91,8 +102,9 @@
       v.addElement("Hi there!");
       v.addElement("This'll be a SOAP Array");
   
  -    Object ret = client.invoke(SERVICE_NAME, "echoArray",
  -                        new Object [] { v });
  +    call.setOperationName( "echoArray" );
  +    call.setProperty( Call.NAMESPACE, SERVICE_NAME );
  +    Object ret = call.invoke( new Object[] { v } );
       if (!equals(v, ret)) assertEquals("Echo Array mangled the result.  Result is underneath\n"
+ ret, v, ret);
     }
   
  
  
  

Mime
View raw message