本文整理汇总了Java中org.apache.axis2.transport.http.SimpleHTTPServer.start方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleHTTPServer.start方法的具体用法?Java SimpleHTTPServer.start怎么用?Java SimpleHTTPServer.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.transport.http.SimpleHTTPServer
的用法示例。
在下文中一共展示了SimpleHTTPServer.start方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public static synchronized void start(String repository, String axis2xml) throws Exception {
if (count == 0) {
ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
receiver = new SimpleHTTPServer(er, TESTING_PORT);
try {
receiver.start();
System.out.print("Server started on port "
+ TESTING_PORT + ".....");
} catch (Exception e) {
throw AxisFault.makeFault(e);
}
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {
throw new AxisFault("Thread interuptted", e1);
}
}
count++;
}
示例2: setUp
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
protected void setUp() throws Exception {
service = Utils.createSimpleService(serviceName,
Echo.class.getName(),
operationName);
UtilServer.deployService(service);
callbackOperation = "callback";
AxisService callbackService = Utils.createSimpleInOnlyService(new QName(callbackServiceName),new MessageReceiver(){
public void receive(MessageContext messageCtx) throws AxisFault {
SOAPEnvelope envelope = messageCtx.getEnvelope();
TestingUtils.compareWithCreatedOMElement(envelope.getBody().getFirstElement());
received = true;
}
},new QName(callbackOperation));
UtilServer.deployService(callbackService);
receiver = new SimpleHTTPServer(UtilServer.getConfigurationContext(), callbackserverPort);
receiver.start();
}
示例3: start
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public static synchronized void start(String repository) throws Exception {
if (count == 0) {
ConfigurationContext er = getNewConfigurationContext(repository);
receiver = new SimpleHTTPServer(er, TESTING_PORT);
try {
receiver.start();
System.out.print("Server started on port "
+ TESTING_PORT + ".....");
} finally {
}
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {
throw new AxisFault("Thread interuptted", e1);
}
}
count++;
}
示例4: setUp
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
protected void setUp() throws Exception {
if (count == 0) {
int testingPort = findAvailablePort();
targetEPR = new EndpointReference(
"http://127.0.0.1:" + (testingPort)
+ "/axis2/services/EchoXMLService/echoOM");
File configFile =
new File(System.getProperty("basedir", ".") + "/test-resources/axis2.xml");
configurationContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(null, configFile
.getAbsolutePath());
server = new SimpleHTTPServer(configurationContext, testingPort);
try {
server.start();
} finally {
}
service = Utils.createSimpleService(serviceName,
org.apache.axis2.json.Echo.class.getName(),
operationName);
server.getConfigurationContext().getAxisConfiguration().addService(
service);
}
count++;
}
示例5: deployAndStartService
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public void deployAndStartService() {
try {
ConfigurationContext confContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
AXIS2_REPOSITORY_LOCATION, AXIS2_CONFIG_FILE);
// add the service
// Configurator configurator = new Configurator();
// ClassDeployer classDeployer = new ClassDeployer(confContext, configurator);
// classDeployer.deployClass(Service2.class);
SimpleHTTPServer simpleHttpServer = new SimpleHTTPServer(confContext, 5555);
simpleHttpServer.start();
System.out.println("Server started on port 5555 ");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
}
} catch (AxisFault axisFault) {
axisFault.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
示例6: start
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public static synchronized int start(String repository) throws Exception {
int testingPort = 0;
if (count == 0) {
ConfigurationContext er = getNewConfigurationContext(repository);
testingPort = findAvailablePort();
receiver = new SimpleHTTPServer(er, testingPort);
receiver.start();
System.out.print("Server started on port " + testingPort + ".....");
try {
Thread.sleep(2000);
} catch (InterruptedException e1) {
throw new AxisFault("Thread interupted", e1);
}
}
count++;
return testingPort;
}
示例7: startServer
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public void startServer() {
try {
// creating a configuration context object
ConfigurationContext confContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
AXIS2_REPOSITORY, AXIS2_CONF);
SimpleHTTPServer simpleHttpServer = new SimpleHTTPServer(confContext, 8080);
simpleHttpServer.start();
System.out.println("Server started on port 8080 ");
try {
Thread.sleep(2000000);
} catch (InterruptedException e) {
}
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
}
}
示例8: suite
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public static Test suite() {
return new TestSetup(new TestSuite(FastInfosetTest.class)) {
public void setUp() throws Exception {
System.out.println("Setting up the Simple HTTP Server");
int port = findAvailablePort();
port = 5555; //Uncomment to test with tcpmon
target = new EndpointReference("http://127.0.0.1:" + (port)
+ "/axis2/services/SimpleAddService");
File configFile = new File(System.getProperty("basedir",".") + "/test-resources/axis2.xml");
configurationContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem("target/test-classes", configFile
.getAbsolutePath());
server = new SimpleHTTPServer(configurationContext, port);
server.start();
service = AxisService.createService("org.apache.axis2.fastinfoset.SimpleAddService",
server.getConfigurationContext().getAxisConfiguration());
server.getConfigurationContext().getAxisConfiguration().addService(
service);
System.out.println("Simple HTTP Server is started");
}
public void tearDown() throws Exception {
server.stop();
System.out.println("Stopped the Simple HTTP Server");
}
};
}
示例9: start
import org.apache.axis2.transport.http.SimpleHTTPServer; //导入方法依赖的package包/类
public void start()throws AxisFault {
try {
//Register the callback service
AxisService messageCollectorService = new AxisService("MessageCollector");
MessageReceiver messageReceiver = new MessageReceiver() {
public void receive(MessageContext messageCtx) throws AxisFault {
if(callback != null){
callback.mesageReceived(messageCtx.getEnvelope());
}else{
System.out.println("Received " + messageCtx.getEnvelope());
}
}
};
InOutAxisOperation operation1 = new InOutAxisOperation(new QName("receive"));
operation1.setMessageReceiver(messageReceiver);
messageCollectorService.addOperation(operation1);
configContext.getAxisConfiguration().addService(messageCollectorService);
axis2Server = new SimpleHTTPServer(configContext, 7777);
axis2Server.start();
eventSinkUrl = axis2Server.getEPRForService(messageCollectorService.getName(), InetAddress.getLocalHost().getHostName());
} catch (UnknownHostException e) {
throw AxisFault.makeFault(e);
}
}