@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; }
WSDL2Constants.MEP_URI_IN_OUT.equals(mepURI) || WSDL2Constants.MEP_URI_IN_OUT.equals(mepURI)) { abOpdesc = new InOutAxisOperation(); } else if (WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mepURI) || WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mepURI) || WSDL2Constants.MEP_URI_IN_OPTIONAL_OUT.equals(mepURI)) { abOpdesc = new InOutAxisOperation(); } else if (WSDL2Constants.MEP_URI_OUT_IN.equals(mepURI) || WSDL2Constants.MEP_URI_OUT_IN.equals(mepURI) ||
new InOutAxisOperation(SynapseConstants.SYNAPSE_OPERATION_NAME); AxisOperation subscribeOperation = new InOutAxisOperation(new QName(EventingConstants.WSE_SUBSCRIBE_OP)); AxisOperation unsubscribeOperation = new InOutAxisOperation(new QName(EventingConstants.WSE_UNSUBSCRIBE_OP)); AxisOperation renewOperation = new InOutAxisOperation(new QName(EventingConstants.WSE_RENEW_OP)); AxisOperation getStatusOperation = new InOutAxisOperation(new QName(EventingConstants.WSE_GET_STATUS_OP)); AxisOperation subscriptionEndOperation = new InOutAxisOperation(new QName(EventingConstants.WSE_SUBSCRIPTIONEND_OP));
AxisOperation axisOp = new InOutAxisOperation(new QName("echoOMElement")); axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); axisOp = new InOutAxisOperation(new QName("echoOMElementNoResponse")); axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC);
public static AxisService createSimpleService(QName serviceName, MessageReceiver messageReceiver, String className, QName opName) throws AxisFault { AxisService service = new AxisService(serviceName.getLocalPart()); service.setClassLoader(getContextClassLoader_DoPriv()); service.addParameter(new Parameter(Constants.SERVICE_CLASS, className)); AxisOperation axisOp = new InOutAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(), axisOp); return service; }
/** * Adds Synapse Service to Axis2 configuration which enables the main message mediation. * * @throws AxisFault if an error occurs during Axis2 service initialization */ private void deploySynapseService() throws AxisFault { log.info("Deploying the Synapse service..."); // Dynamically initialize the Synapse Service and deploy it into Axis2 AxisConfiguration axisCfg = configurationContext.getAxisConfiguration(); AxisService synapseService = new AxisService(SynapseConstants.SYNAPSE_SERVICE_NAME); AxisOperation mediateOperation = new InOutAxisOperation( SynapseConstants.SYNAPSE_OPERATION_NAME); mediateOperation.setMessageReceiver(new SynapseMessageReceiver()); synapseService.addOperation(mediateOperation); List<String> transports = new ArrayList<String>(); transports.add(Constants.TRANSPORT_HTTP); transports.add(Constants.TRANSPORT_HTTPS); synapseService.setExposedTransports(transports); AxisServiceGroup synapseServiceGroup = new AxisServiceGroup(axisCfg); synapseServiceGroup.setServiceGroupName(SynapseConstants.SYNAPSE_SERVICE_NAME); synapseServiceGroup.addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true"); synapseServiceGroup.addService(synapseService); axisCfg.addServiceGroup(synapseServiceGroup); }
public static AxisService createSimpleService(QName serviceName, MessageReceiver messageReceiver, String className, QName opName) throws AxisFault { AxisService service = new AxisService(serviceName.getLocalPart()); service.setClassLoader(getContextClassLoader_DoPriv()); service.addParameter(new Parameter(Constants.SERVICE_CLASS, className)); AxisOperation axisOp = new InOutAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(), axisOp); return service; }
AxisOperation axisOp = new InOutAxisOperation(new QName("echoOMElement")); axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); axisOp = new InOutAxisOperation(new QName("echoOMElementNoResponse")); axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC);
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); } }
AxisOperation axisOp = new InOutAxisOperation(new QName("echoOMElement")); axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); axisOp = new InOutAxisOperation(new QName("echoOMElementNoResponse")); axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC);
/** * Adds Synapse Service to Axis2 configuration which enables the main message mediation. * * @throws AxisFault if an error occurs during Axis2 service initialization */ private void deploySynapseService() throws AxisFault { log.info("Deploying the Synapse service..."); // Dynamically initialize the Synapse Service and deploy it into Axis2 AxisConfiguration axisCfg = configurationContext.getAxisConfiguration(); AxisService synapseService = new AxisService(SynapseConstants.SYNAPSE_SERVICE_NAME); AxisOperation mediateOperation = new InOutAxisOperation( SynapseConstants.SYNAPSE_OPERATION_NAME); mediateOperation.setMessageReceiver(new SynapseMessageReceiver()); synapseService.addOperation(mediateOperation); List<String> transports = new ArrayList<String>(); transports.add(Constants.TRANSPORT_HTTP); transports.add(Constants.TRANSPORT_HTTPS); synapseService.setExposedTransports(transports); AxisServiceGroup synapseServiceGroup = new AxisServiceGroup(axisCfg); synapseServiceGroup.setServiceGroupName(SynapseConstants.SYNAPSE_SERVICE_NAME); synapseServiceGroup.addParameter(SynapseConstants.HIDDEN_SERVICE_PARAM, "true"); synapseServiceGroup.addService(synapseService); axisCfg.addServiceGroup(synapseServiceGroup); }
OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx); axis2MC.setServiceContext(svcCtx); axis2MC.setOperationContext(opCtx);
OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx); axis2MC.setServiceContext(svcCtx); axis2MC.setOperationContext(opCtx);
private AxisOperation processOperationValidation(AxisService proxyService) throws AxisFault { AxisOperation mediateOperation = new InOutAxisOperation( SynapseConstants.SYNAPSE_OPERATION_NAME); // Set the names of the two messages so that Axis2 is able to produce a WSDL (see SYNAPSE-366): mediateOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE).setName("in"); mediateOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE).setName("out"); // create a custom message receiver for this proxy service ProxyServiceMessageReceiver msgRcvr = new ProxyServiceMessageReceiver(); msgRcvr.setName(name); msgRcvr.setProxy(this); mediateOperation.setMessageReceiver(msgRcvr); mediateOperation.setParent(proxyService); proxyService.addParameter("_default_mediate_operation_", mediateOperation); return mediateOperation; }
/** * Create a empty message context * * @return A context with empty message * @throws AxisFault on an error creating a context */ private MessageContext createMessageContext() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = new Axis2SynapseEnvironment(new SynapseConfiguration()); org.apache.axis2.context.MessageContext axis2MC = new org.apache.axis2.context.MessageContext(); axis2MC.setConfigurationContext(new ConfigurationContext(new AxisConfiguration())); ServiceContext svcCtx = new ServiceContext(); OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx); axis2MC.setServiceContext(svcCtx); axis2MC.setOperationContext(opCtx); axis2MC.setTransportIn(new TransportInDescription("http")); axis2MC.setTo(new EndpointReference("http://localhost:9000/services/SimpleStockQuoteService")); MessageContext mc = new Axis2MessageContext(axis2MC, new SynapseConfiguration(), synapseEnvironment); mc.setMessageID(UIDGenerator.generateURNString()); mc.setEnvelope(OMAbstractFactory.getSOAP12Factory().createSOAPEnvelope()); mc.getEnvelope().addChild(OMAbstractFactory.getSOAP12Factory().createSOAPBody()); return mc; } }
/** * Create a empty message context * * @return A context with empty message * @throws AxisFault on an error creating a context */ private MessageContext createMessageContext() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = new Axis2SynapseEnvironment(new SynapseConfiguration()); org.apache.axis2.context.MessageContext axis2MC = new org.apache.axis2.context.MessageContext(); axis2MC.setConfigurationContext(new ConfigurationContext(new AxisConfiguration())); ServiceContext svcCtx = new ServiceContext(); OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx); axis2MC.setServiceContext(svcCtx); axis2MC.setOperationContext(opCtx); MessageContext mc = new Axis2MessageContext(axis2MC, new SynapseConfiguration(), synapseEnvironment); mc.setMessageID(UIDGenerator.generateURNString()); mc.setEnvelope(OMAbstractFactory.getSOAP12Factory().createSOAPEnvelope()); mc.getEnvelope().addChild(OMAbstractFactory.getSOAP12Factory().createSOAPBody()); return mc; }
/** * Create a empty message context. * * @return A context with empty message * @throws AxisFault on an error creating a context */ private MessageContext createMessageContext() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = new Axis2SynapseEnvironment(new SynapseConfiguration()); org.apache.axis2.context.MessageContext axis2MC = new org.apache.axis2.context.MessageContext(); axis2MC.setConfigurationContext(new ConfigurationContext(new AxisConfiguration())); ServiceContext svcCtx = new ServiceContext(); OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx); axis2MC.setServiceContext(svcCtx); axis2MC.setOperationContext(opCtx); MessageContext mc = new Axis2MessageContext(axis2MC, new SynapseConfiguration(), synapseEnvironment); mc.setMessageID(UIDGenerator.generateURNString()); mc.setEnvelope(OMAbstractFactory.getSOAP12Factory().createSOAPEnvelope()); mc.getEnvelope().addChild(OMAbstractFactory.getSOAP12Factory().createSOAPBody()); return mc; } }
/** * Create a empty message context * * @return A context with empty message * @throws AxisFault on an error creating a context */ private MessageContext createMessageContext() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = new Axis2SynapseEnvironment(new SynapseConfiguration()); org.apache.axis2.context.MessageContext axis2MC = new org.apache.axis2.context.MessageContext(); axis2MC.setConfigurationContext(new ConfigurationContext(new AxisConfiguration())); ServiceContext svcCtx = new ServiceContext(); OperationContext opCtx = new OperationContext(new InOutAxisOperation(), svcCtx); axis2MC.setServiceContext(svcCtx); axis2MC.setOperationContext(opCtx); axis2MC.setTransportIn(new TransportInDescription("http")); // axis2MC.setTo(new EndpointReference("http://localhost:9000/services/SimpleStockQuoteService")); MessageContext mc = new Axis2MessageContext(axis2MC, new SynapseConfiguration(), synapseEnvironment); mc.setMessageID(UIDGenerator.generateURNString()); mc.setEnvelope(OMAbstractFactory.getSOAP12Factory().createSOAPEnvelope()); mc.getEnvelope().addChild(OMAbstractFactory.getSOAP12Factory().createSOAPBody()); return mc; } }