当前位置: 首页>>代码示例>>Java>>正文


Java SimpleHTTPServer类代码示例

本文整理汇总了Java中org.apache.axis2.transport.http.SimpleHTTPServer的典型用法代码示例。如果您正苦于以下问题:Java SimpleHTTPServer类的具体用法?Java SimpleHTTPServer怎么用?Java SimpleHTTPServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleHTTPServer类属于org.apache.axis2.transport.http包,在下文中一共展示了SimpleHTTPServer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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++;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:UtilServer.java

示例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();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:ThirdPartyResponseRawXMLTest.java

示例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++;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:UtilServer.java

示例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++;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:JSONIntegrationTest.java

示例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.
        }
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:ServerTest.java

示例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;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:22,代码来源:UtilServer.java

示例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();
    }

}
 
开发者ID:syodage,项目名称:Axis2-Samples,代码行数:21,代码来源:TestServer.java

示例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");
        }
    };
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:36,代码来源:FastInfosetTest.java

示例9: init

import org.apache.axis2.transport.http.SimpleHTTPServer; //导入依赖的package包/类
public void init() {
    TestLogger.logger.debug(">> repositoryDir = " + repositoryDir);
    TestLogger.logger.debug(">> axis2.xml     = " + axis2xml);

    try {
        ConfigurationContext config = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                repositoryDir, axis2xml);
        server = new SimpleHTTPServer(config, port);
    } catch (AxisFault e) {
        e.printStackTrace();
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:13,代码来源:SimpleServer.java

示例10: 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);
    }
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:28,代码来源:SimpleMessageReceiver.java


注:本文中的org.apache.axis2.transport.http.SimpleHTTPServer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。