1 22 package org.jboss.test.webservice.wsdlimport; 23 24 import junit.framework.Test; 25 import org.jboss.test.JBossTestCase; 26 import org.jboss.test.webservice.WebserviceTestBase; 27 28 import javax.xml.namespace.QName ; 29 import javax.xml.rpc.Call ; 30 import javax.xml.rpc.Service ; 31 import javax.xml.rpc.ServiceFactory ; 32 import java.net.URL ; 33 34 40 public class AbsoluteImportTestCase extends WebserviceTestBase 41 { 42 private final String WSDL_LOCATION = "http://" + getServerHost() + ":8080/ws4ee-wsdlimport-absolute2/HelloPort?wsdl"; 43 private String NAMESPACE = "http://test.jboss.org/ws4eesimple"; 44 private final QName SERVICE_NAME = new QName (NAMESPACE, "HelloService"); 45 46 49 public AbsoluteImportTestCase(String name) 50 { 51 super(name); 52 } 53 54 57 public static Test suite() throws Exception 58 { 59 return getDeploySetup(AbsoluteImportTestCase.class, "ws4ee-wsdlimport-absolute1.war, ws4ee-wsdlimport-absolute2.war"); 60 } 61 62 65 public void testHello() throws Exception 66 { 67 ServiceFactory serviceFactory = ServiceFactory.newInstance(); 68 Service service = serviceFactory.createService(new URL (WSDL_LOCATION), SERVICE_NAME); 69 Call call = (Call )service.createCall(new QName (NAMESPACE, "HelloWsPort"), "sayHello"); 70 String retstr = (String )call.invoke(new Object []{"Hello"}); 71 assertEquals("'Hello' to you too!", retstr); 72 } 73 } 74 | Popular Tags |