| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 
 |  
1   import org.apache.axis.client.Call;
2   import org.apache.axis.client.Service;
3   import javax.xml.namespace.QName;
4   
5   public class TestClient {
6     public static void main(String [] args) {
7       try {
8         String endpoint =
9             "http://ws.apache.org:5049/axis/services/echo";
10  
11        Service  service = new Service();
12        Call     call    = (Call) service.createCall();
13  
14        call.setTargetEndpointAddress( new java.net.URL(endpoint) );
15        call.setOperationName(new QName("http://soapinterop.org/", echoString"));
16  
17        String ret = (String) call.invoke( new Object[] { "Hello!" } );
18  
19        System.out.println("Sent 'Hello!', got '" + ret + "'");
20      } catch (Exception e) {
21        System.err.println(e.toString());
22      }
23    }
24  } | 
Partager