01: package samples.jaxrpc.address;
02:
03: import javax.xml.namespace.QName;
04: import javax.xml.rpc.Service;
05: import javax.xml.rpc.ServiceFactory;
06: import java.net.URL;
07:
08: public class AddressClient {
09: public static void main(String[] args) throws Exception {
10: URL urlWsdl = new URL(
11: "http://localhost:8080/axis/services/Address?wsdl");
12: String nameSpaceUri = "http://address.jaxrpc.samples";
13: String serviceName = "AddressServiceService";
14: String portName = "Address";
15:
16: ServiceFactory serviceFactory = ServiceFactory.newInstance();
17: Service service = serviceFactory.createService(urlWsdl,
18: new QName(nameSpaceUri, serviceName));
19: AddressService myProxy = (AddressService) service
20: .getPort(new QName(nameSpaceUri, portName),
21: AddressService.class);
22: AddressBean addressBean = new AddressBean();
23: addressBean.setStreet("55, rue des Lilas");
24: System.out.println(myProxy.updateAddress(addressBean, 75005));
25: }
26: }
|