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