1 7 8 package test.wsdl.primitiveWrappers; 9 10 public class TypeWrapper_ServiceTestCase extends junit.framework.TestCase { 11 public TypeWrapper_ServiceTestCase(java.lang.String name) { 12 super(name); 13 } 14 15 public void testTypeWrapperWSDL() throws Exception { 16 javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance(); 17 java.net.URL url = new java.net.URL (new test.wsdl.primitiveWrappers.TypeWrapper_ServiceLocator().getTypeWrapperAddress() + "?WSDL"); 18 javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.primitiveWrappers.TypeWrapper_ServiceLocator().getServiceName()); 19 assertTrue(service != null); 20 } 21 22 public void test1TypeWrapperTestWrapping() throws Exception { 23 test.wsdl.primitiveWrappers.TypeWrapper_BindingStub binding; 24 try { 25 binding = (test.wsdl.primitiveWrappers.TypeWrapper_BindingStub) 26 new test.wsdl.primitiveWrappers.TypeWrapper_ServiceLocator().getTypeWrapper(); 27 } 28 catch (javax.xml.rpc.ServiceException jre) { 29 if(jre.getLinkedCause()!=null) 30 jre.getLinkedCause().printStackTrace(); 31 throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre); 32 } 33 assertNotNull("binding is null", binding); 34 35 binding.setTimeout(60000); 37 38 java.lang.Integer value = null; 40 Bean bean = new test.wsdl.primitiveWrappers.Bean(); 41 bean.setPrimitive(5); 42 bean.setWrapped(null); value = binding.testWrapping(new java.lang.Integer (5), bean); 45 assertEquals("Wrong result from service", value, new Integer (5)); 46 } 47 48 } 49 | Popular Tags |