1 22 package org.jboss.test.webservice.samples; 23 24 import junit.framework.Test; 25 import org.jboss.test.JBossTestCase; 26 27 import javax.xml.namespace.QName ; 28 import javax.xml.rpc.Service ; 29 import javax.xml.rpc.ServiceFactory ; 30 import java.net.URL ; 31 32 38 public class ServerSideJSETestCase extends JBossTestCase 39 { 40 public ServerSideJSETestCase(String name) 41 { 42 super(name); 43 } 44 45 46 public static Test suite() throws Exception  47 { 48 return getDeploySetup(ServerSideJSETestCase.class, "ws4ee-samples-server-jse.war"); 49 } 50 51 public void testJSEEndpointAccess() throws Exception  52 { 53 URL url = new URL ("http://" + getServerHost() + ":8080/ws4ee-samples-server-jse/Organization?wsdl"); 54 QName qname = new QName ("http://org.jboss.test.webservice/samples", "OrganizationService"); 55 56 ServiceFactory factory = ServiceFactory.newInstance(); 57 Service service = factory.createService(url, qname); 58 Organization endpoint = (Organization)service.getPort(Organization.class); 59 60 String info = endpoint.getContactInfo("mafia"); 61 assertEquals("The 'mafia' boss is currently out of office, please call again.", info); 62 } 63 } 64 | Popular Tags |