public static synchronized void start(String repository, String axis2xml) throws Exception { if (receiver != null) { throw new IllegalStateException("Server already started"); } ConfigurationContext er = getNewConfigurationContext(repository, axis2xml); receiver = new SimpleHTTPServer(er, TESTING_PORT); receiver.start(); System.out.print("Server started on port " + TESTING_PORT + "....."); }
public static void main(String[] args) throws AxisFault { String axisServerRepo = null; if (args!=null && args.length>0) axisServerRepo = args[0]; if (axisServerRepo!=null && !"".equals(axisServerRepo)) { AXIS2_SERVER_PATH = axisServerRepo; } if ("<SANDESHA2_HOME>".equals(SANDESHA2_HOME)){ System.out.println("ERROR: Please change <SANDESHA2_HOME> to your Sandesha2 installation directory."); return; } System.out.println("Starting sandesha2 server..."); String axis2_xml = AXIS2_SERVER_PATH + "server_axis2.xml"; ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_SERVER_PATH,axis2_xml); SimpleHTTPServer server = new SimpleHTTPServer (configContext,8080); server.start(); } }
@Override protected void startServer(ConfigurationContext configurationContext) throws Throwable { port = PortAllocator.allocatePort(); server = new SimpleHTTPServer(configurationContext, port); server.start(); }
@Override protected void before() throws Throwable { port = PortAllocator.allocatePort(); configurationContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(repositoryPath); server = new SimpleHTTPServer(configurationContext, port); server.start(); }
/** * @param args * @throws AxisFault * @throws Exception */ public void start() throws AxisFault { ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); context.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); context.getAxisConfiguration().addParameter(SUPPORT_SINGLE_OP, Boolean.valueOf(true)); context.getAxisConfiguration().addParameter(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); Map<String, MessageReceiver> msgRecieverMap = new HashMap<String, MessageReceiver>(); ConsumerMsgReceiver conMsgRcv = new ConsumerMsgReceiver(handler); msgRecieverMap.put("http://www.w3.org/ns/wsdl/in-only", conMsgRcv); AxisService service = AxisService.createService(ConsumerService.class.getName(), context.getAxisConfiguration(), msgRecieverMap, null, null, ConsumerServer.class.getClassLoader()); context.getAxisConfiguration().addService(service); server = new SimpleHTTPServer(context, this.listeningPort); server.start(); consumerService = service; }
/** * @param args * @throws AxisFault * @throws Exception */ public void start() throws AxisFault { ConfigurationContext context = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null); context.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); context.getAxisConfiguration().addParameter(SUPPORT_SINGLE_OP, Boolean.valueOf(true)); context.getAxisConfiguration().addParameter(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false)); Map<String, MessageReceiver> msgRecieverMap = new HashMap<String, MessageReceiver>(); ConsumerMsgReceiver conMsgRcv = new ConsumerMsgReceiver(handler); msgRecieverMap.put("http://www.w3.org/ns/wsdl/in-only", conMsgRcv); AxisService service = AxisService.createService(ConsumerService.class.getName(), context.getAxisConfiguration(), msgRecieverMap, null, null, ConsumerServer.class.getClassLoader()); context.getAxisConfiguration().addService(service); server = new SimpleHTTPServer(context, this.listeningPort); server.start(); consumerService = service; }
public TransportInDescription createTransportInDescription() throws Exception { TransportInDescription desc = new TransportInDescription("http"); desc.setReceiver(new LifecycleFixTransportListenerProxy(new SimpleHTTPServer(), port)); desc.addParameter(new Parameter(SimpleHTTPServer.PARAM_PORT, String.valueOf(port))); return desc; }
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); } }
ConfigurationContext configctx = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repository, null); SimpleHTTPServer receiver = new SimpleHTTPServer(configctx, port); Runtime.getRuntime().addShutdownHook(new ShutdownThread(receiver)); receiver.start();
ConfigurationContext configctx = ConfigurationContextFactory .createConfigurationContextFromFileSystem(repository, null); SimpleHTTPServer receiver = new SimpleHTTPServer(configctx, port); Runtime.getRuntime().addShutdownHook(new ShutdownThread(receiver)); receiver.start();