URL urlWsdl = new URL("http://localhost:8080/axis/services/AddressInOut?wsdl");
String nameSpaceUri = "http://jaxrpcdynproxy.wsdl.test";
String serviceName = "AddressInOut";
String portName = "AddressInOut";
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service service = serviceFactory.createService(urlWsdl, new
QName(nameSpaceUri, serviceName));
AddressService myProxy = (AddressService) service.getPort(new
QName(nameSpaceUri, portName), AddressService.class);
AddressBean addressBean = new AddressBean();
addressBean.setStreet("55, rue des Lilas");
AddressBeanHolder addressBeanHolder = new AddressBeanHolder(addressBean);
QName qName = new QName("http://jaxrpcdynproxy.wsdl.test", "AddressBean");
AxisClientProxy clientProxy = (AxisClientProxy) Proxy.getInvocationHandler(myProxy);
clientProxy.getCall().registerTypeMapping(AddressBean.class,
qName,
BeanSerializerFactory.class,
BeanDeserializerFactory.class,
false);
myProxy.updateAddress(addressBeanHolder, 75005);
addressBean = addressBeanHolder.value;
assertEquals("New postcode is not the expected 75005", addressBean.getPostcode(), 75005);