1 7 8 package docStyle.zipCodeNW; 9 10 public class ZipCodeResolverTestCase extends junit.framework.TestCase { 11 public ZipCodeResolverTestCase(java.lang.String name) { 12 super(name); 13 } 14 public void test1ZipCodeResolverSoapShortZipCode() { 15 docStyle.zipCodeNW.ZipCodeResolverSoap binding; 16 try { 17 binding = new docStyle.zipCodeNW.ZipCodeResolverLocator().getZipCodeResolverSoap(); 18 } 19 catch (javax.xml.rpc.ServiceException jre) { 20 if(jre.getLinkedCause()!=null) 21 jre.getLinkedCause().printStackTrace(); 22 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 23 } 24 assertTrue("binding is null", binding != null); 25 26 try { 27 docStyle.zipCodeNW.ShortZipCode zc = new docStyle.zipCodeNW.ShortZipCode(); 28 zc.setAccessCode("9999"); 29 zc.setAddress("607 Trinity"); 30 zc.setCity("Austin"); 31 zc.setState("TX"); 32 33 docStyle.zipCodeNW.ShortZipCodeResponse value = null; 34 value = binding.shortZipCode(zc); 35 36 System.out.println("zipcode=" + value.getShortZipCodeResult()); 37 38 } 39 catch (java.rmi.RemoteException re) { 40 throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re); 41 } 42 } 43 44 public static void main(String [] args) { 45 46 ZipCodeResolverTestCase t = new ZipCodeResolverTestCase("KJH"); 47 t.test1ZipCodeResolverSoapShortZipCode(); 48 49 } 50 51 } 52 | Popular Tags |