01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
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: public static void main(String[] args) {
26: try {
27: String endpoint = "http://nagoya.apache.org:5049/axis/services/echo";
28:
29: Service service = new Service();
30: Call call = (Call) service.createCall();
31:
32: call.setTargetEndpointAddress(new java.net.URL(endpoint));
33: call.setOperationName(new QName("http://soapinterop.org/",
34: "echoString"));
35:
36: // Call to addParameter/setReturnType as described in user-guide.html
37: //call.addParameter("testParam",
38: // org.apache.axis.Constants.XSD_STRING,
39: // javax.xml.rpc.ParameterMode.IN);
40: //call.setReturnType(org.apache.axis.Constants.XSD_STRING);
41:
42: String ret = (String) call
43: .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: }
|