@Override protected AxisOperation createOperation() { AxisOperation operation = new InOnlyAxisOperation(new QName("in")); operation.setMessageReceiver(messageReceiver); return operation; }
@Override protected AxisOperation createOperation() { AxisOperation operation = new InOnlyAxisOperation(new QName("in")); operation.setMessageReceiver(messageReceiver); return operation; }
@Override protected AxisOperation createOperation() { AxisOperation operation = new InOnlyAxisOperation(new QName("in")); operation.setMessageReceiver(messageReceiver); return operation; }
public void setMessageReceivers(AxisService service) { Iterator<AxisOperation> iterator = service.getOperations(); while (iterator.hasNext()) { AxisOperation operation = iterator.next(); String MEP = operation.getMessageExchangePattern(); if (MEP != null) { try { if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) { Class<?> inOnlyMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"); MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver.newInstance(); operation.setMessageReceiver(messageReceiver); } else { Class<?> inoutMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCMessageReceiver"); MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver.newInstance(); operation.setMessageReceiver(inOutmessageReceiver); } } catch (ClassNotFoundException e) { log.error(e.getMessage(), e); } catch (InstantiationException e) { log.error(e.getMessage(), e); } catch (IllegalAccessException e) { log.error(e.getMessage(), e); } } } }
public void setMessageReceivers(AxisService service) { Iterator<AxisOperation> iterator = service.getOperations(); while (iterator.hasNext()) { AxisOperation operation = iterator.next(); String MEP = operation.getMessageExchangePattern(); if (MEP != null) { try { if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)) { Class<?> inOnlyMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"); MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver.newInstance(); operation.setMessageReceiver(messageReceiver); } else { Class<?> inoutMessageReceiver = Loader.loadClass( "org.apache.axis2.rpc.receivers.RPCMessageReceiver"); MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver.newInstance(); operation.setMessageReceiver(inOutmessageReceiver); } } catch (ClassNotFoundException e) { log.error(e.getMessage(), e); } catch (InstantiationException e) { log.error(e.getMessage(), e); } catch (IllegalAccessException e) { log.error(e.getMessage(), e); } } } }
private void setDefaultMessageReceivers() { Iterator operations = service.getPublishedOperations().iterator(); while (operations.hasNext()) { AxisOperation operation = (AxisOperation) operations.next(); if (operation.getMessageReceiver() == null) { MessageReceiver messageReceiver = loadDefaultMessageReceiver( operation.getMessageExchangePattern(), service); if (messageReceiver == null && // we assume that if the MEP is ROBUST_IN_ONLY then the in-out // MR can handle that WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation .getMessageExchangePattern())) { messageReceiver = loadDefaultMessageReceiver( WSDL2Constants.MEP_URI_IN_OUT, service); } operation.setMessageReceiver(messageReceiver); } } }
private void setDefaultMessageReceivers() { Iterator operations = service.getPublishedOperations().iterator(); while (operations.hasNext()) { AxisOperation operation = (AxisOperation) operations.next(); if (operation.getMessageReceiver() == null) { MessageReceiver messageReceiver = loadDefaultMessageReceiver( operation.getMessageExchangePattern(), service); if (messageReceiver == null && // we assume that if the MEP is ROBUST_IN_ONLY then the in-out // MR can handle that WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(operation .getMessageExchangePattern())) { messageReceiver = loadDefaultMessageReceiver( WSDL2Constants.MEP_URI_IN_OUT, service); } operation.setMessageReceiver(messageReceiver); } } }
private void setMessageReceivers(Wire wire, AxisService axisService) throws Exception { Map<String, InvocationChain> interceptors = new HashMap<String, InvocationChain>(); for (InvocationChain chain : wire.getInvocationChains()) { interceptors.put(chain.getPhysicalOperation().getName(), chain); } Utils.fillAxisService(axisService, configurationContext.getAxisConfiguration(), null, null); for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation) i.next(); InvocationChain invocationChain = interceptors.get(axisOp.getName().getLocalPart()); MessageReceiver messageReceiver = null; if (WSDL2Constants.MEP_URI_IN_ONLY.equals(axisOp.getMessageExchangePattern()) || WSDL2Constants.MEP_URI_ROBUST_IN_ONLY.equals(axisOp.getMessageExchangePattern())) { messageReceiver = new InOnlyServiceProxyHandler(invocationChain); } else {//Default MEP is IN-OUT for backward compatibility messageReceiver = new InOutServiceProxyHandler(invocationChain); } axisOp.setMessageReceiver(messageReceiver); } }
public static AxisService createSimpleInOnlyService(QName serviceName, MessageReceiver messageReceiver, QName opName) throws AxisFault { AxisService service = new AxisService(serviceName.getLocalPart()); service.setClassLoader(getContextClassLoader_DoPriv()); AxisOperation axisOp = new InOnlyAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(), axisOp); return service; }
public static AxisService createSimpleInOnlyService(QName serviceName, MessageReceiver messageReceiver, QName opName) throws AxisFault { AxisService service = new AxisService(serviceName.getLocalPart()); service.setClassLoader(getContextClassLoader_DoPriv()); AxisOperation axisOp = new InOnlyAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/" + opName.getLocalPart(), axisOp); return service; }
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; }
axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp);
axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver()); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp);
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 createSimpleServiceforClient(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 OutInAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(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 createSimpleServiceforClient(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 OutInAxisOperation(opName); axisOp.setMessageReceiver(messageReceiver); axisOp.setStyle(WSDLConstants.STYLE_RPC); service.addOperation(axisOp); return service; }
public static void createAxisServiceProviders(AxisService axisService, RuntimeEndpoint endpoint, WebServiceBinding wsBinding, ExtensionPointRegistry extensionPoints) { for (Iterator<?> i = axisService.getOperations(); i.hasNext();) { AxisOperation axisOp = (AxisOperation)i.next(); Operation op = getOperation(axisOp, wsBinding); if (op != null) { if (op.isNonBlocking()) { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_ONLY); } else { axisOp.setMessageExchangePattern(WSDL2Constants.MEP_URI_IN_OUT); } MessageReceiver msgrec = null; TuscanyServiceProvider serviceProvider = new TuscanyServiceProvider(extensionPoints, endpoint, wsBinding, op); if (op.isNonBlocking()) { msgrec = new Axis2ServiceInMessageReceiver(serviceProvider); } else { msgrec = new Axis2ServiceInOutSyncMessageReceiver(serviceProvider); } axisOp.setMessageReceiver(msgrec); } } }
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; }