1 7 8 10 package org.jboss.test.jbossnet; 11 12 import org.jboss.axis.client.AxisClient; 13 import org.jboss.axis.client.ServiceFactory; 14 import org.jboss.axis.configuration.FileProvider; 15 import org.jboss.test.JBossTestCase; 16 17 import javax.xml.namespace.QName ; 18 import javax.xml.rpc.Service ; 19 import java.net.URL ; 20 21 27 public abstract class JBossNetTestBase extends JBossTestCase 28 { 29 30 protected String PROTOCOL = "http://"; 31 32 33 protected String ADDRESS = "" + getServerHost() + ":8080/"; 34 35 36 protected String AXIS_CONTEXT = ADDRESS + "jboss-net/"; 37 38 39 protected String SERVICE_PORT = AXIS_CONTEXT + "services"; 40 41 42 protected String SERVICES_LOCATION = PROTOCOL + SERVICE_PORT; 43 44 45 public JBossNetTestBase(String name) 46 { 47 super(name); 48 } 49 50 52 public Service createService(URL wsdlURL, QName serviceQName) throws Exception 53 { 54 ServiceFactory factory = new org.jboss.axis.client.ServiceFactory(); 56 Service service = factory.createService(wsdlURL, serviceQName); 57 58 String config = getAxisConfiguration(); 60 AxisClient clientEngine = new AxisClient(new FileProvider(config)); 61 ((org.jboss.axis.client.Service)service).setEngine(clientEngine); 62 63 return service; 64 } 65 66 68 public Service createService(URL wsdlURL, QName serviceQName, boolean maintainSession) throws Exception 69 { 70 Service service = createService(wsdlURL, serviceQName); 71 ((org.jboss.axis.client.Service)service).setMaintainSession(maintainSession); 72 return service; 73 } 74 75 76 protected String getAxisConfiguration() 77 { 78 return "client-config.wsdd"; 79 } 80 } 81 | Popular Tags |