KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > samples > jaxrpc > address > AddressClient


1 package samples.jaxrpc.address;
2
3 import javax.xml.namespace.QName JavaDoc;
4 import javax.xml.rpc.Service JavaDoc;
5 import javax.xml.rpc.ServiceFactory JavaDoc;
6 import java.net.URL JavaDoc;
7
8 public class AddressClient {
9     public static void main(String JavaDoc[] args) throws Exception JavaDoc {
10         URL JavaDoc urlWsdl = new URL JavaDoc("http://localhost:8080/axis/services/Address?wsdl");
11         String JavaDoc nameSpaceUri = "http://address.jaxrpc.samples";
12         String JavaDoc serviceName = "AddressServiceService";
13         String JavaDoc portName = "Address";
14
15         ServiceFactory JavaDoc serviceFactory = ServiceFactory.newInstance();
16         Service JavaDoc service = serviceFactory.createService(urlWsdl, new
17                 QName JavaDoc(nameSpaceUri, serviceName));
18         AddressService myProxy = (AddressService) service.getPort(new
19                 QName JavaDoc(nameSpaceUri, portName), AddressService.class);
20         AddressBean addressBean = new AddressBean();
21         addressBean.setStreet("55, rue des Lilas");
22         System.out.println(myProxy.updateAddress(addressBean, 75005));
23     }
24 }
Popular Tags