FileDocCategorySizeDatePackage
JAXRPCDynProxyTestCase.javaAPI DocApache Axis 1.42489Sat Apr 22 18:57:28 BST 2006test.wsdl.jaxrpcdynproxy

JAXRPCDynProxyTestCase

public class JAXRPCDynProxyTestCase extends TestCase

Fields Summary
Constructors Summary
public JAXRPCDynProxyTestCase()
Default constructor for use as service

      super("JAXRPCDynProxyTest");
  
public JAXRPCDynProxyTestCase(String name)

      super(name);
  
Methods Summary
public static voidmain(java.lang.String[] args)

      JAXRPCDynProxyTestCase test = new JAXRPCDynProxyTestCase("test");
      test.testInOut();
  
public voidtestInOut()

      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);