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 SimpleEJBTestCase extends JBossTestCase 40 { 41 private final String WSDL_LOCATION = "http://" + getServerHost() + ":8080/ws4ee-simple/HelloEjb?wsdl"; 42 private String NAMESPACE = "http://test.jboss.org/ws4eesimple"; 43 private final QName SERVICE_NAME = new QName (NAMESPACE, "HelloService"); 44 45 48 public SimpleEJBTestCase(String name) 49 { 50 super(name); 51 } 52 53 56 public static Test suite() throws Exception 57 { 58 return getDeploySetup(SimpleEJBTestCase.class, "ws4ee-simple.jar"); 59 } 60 61 64 65 public void testSayHello() 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 |