1 16 17 package samples.userguide.example1; 18 19 import org.apache.axis.client.Call; 20 import org.apache.axis.client.Service; 21 22 import javax.xml.namespace.QName ; 23 24 public class TestClient 25 { 26 public static void main(String [] args) { 27 try { 28 String endpoint = 29 "http://nagoya.apache.org:5049/axis/services/echo"; 30 31 Service service = new Service(); 32 Call call = (Call) service.createCall(); 33 34 call.setTargetEndpointAddress( new java.net.URL (endpoint) ); 35 call.setOperationName(new QName ("http://soapinterop.org/", "echoString") ); 36 37 43 String ret = (String ) call.invoke( new Object [] { "Hello!" } ); 44 45 System.out.println("Sent 'Hello!', got '" + ret + "'"); 46 } catch (Exception e) { 47 System.err.println(e.toString()); 48 } 49 } 50 } 51 | Popular Tags |