@Override protected InOutAxisOperation createOperation() { InOutAxisOperation operation = new InOutAxisOperation(new QName("echo")); operation.setMessageReceiver(new AbstractInOutMessageReceiver() { @Override public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage) throws AxisFault { outMessage.setEnvelope(inMessage.getEnvelope()); } }); return operation; }
@Override protected InOutAxisOperation createOperation() { InOutAxisOperation operation = new InOutAxisOperation(new QName("echo")); operation.setMessageReceiver(new AbstractInOutMessageReceiver() { @Override public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage) throws AxisFault { outMessage.setEnvelope(inMessage.getEnvelope()); } }); return operation; }
@Override protected InOutAxisOperation createOperation() { InOutAxisOperation operation = new InOutAxisOperation(new QName("echo")); operation.setMessageReceiver(new AbstractInOutMessageReceiver() { @Override public void invokeBusinessLogic(MessageContext inMessage, MessageContext outMessage) throws AxisFault { outMessage.setEnvelope(inMessage.getEnvelope()); } }); return operation; }
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); } }