Search in sources :

Example 1 with InOutAxisOperation

use of org.apache.axis2.description.InOutAxisOperation in project wso2-axis2-transports by wso2.

the class AxisEchoEndpoint method createOperation.

@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;
}
Also used : AxisFault(org.apache.axis2.AxisFault) QName(javax.xml.namespace.QName) MessageContext(org.apache.axis2.context.MessageContext) InOutAxisOperation(org.apache.axis2.description.InOutAxisOperation) AbstractInOutMessageReceiver(org.apache.axis2.receivers.AbstractInOutMessageReceiver)

Example 2 with InOutAxisOperation

use of org.apache.axis2.description.InOutAxisOperation in project wso2-axis2-transports by wso2.

the class UtilsTransportServer method deployEchoService.

/**
 * Deploy the standard Echo service with the custom parameters passed in
 * @param name the service name to assign
 * @param parameters the parameters for the service
 * @throws Exception
 */
public void deployEchoService(String name, List<Parameter> parameters) throws Exception {
    AxisService service = new AxisService(name);
    service.setClassLoader(Thread.currentThread().getContextClassLoader());
    service.addParameter(new Parameter(Constants.SERVICE_CLASS, Echo.class.getName()));
    // add operation echoOMElement
    AxisOperation axisOp = new InOutAxisOperation(new QName("echoOMElement"));
    axisOp.setMessageReceiver(new RawXMLINOutMessageReceiver());
    axisOp.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp);
    service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/echoOMElement", axisOp);
    // add operation echoOMElementNoResponse
    axisOp = new InOutAxisOperation(new QName("echoOMElementNoResponse"));
    axisOp.setMessageReceiver(new RawXMLINOnlyMessageReceiver());
    axisOp.setStyle(WSDLConstants.STYLE_RPC);
    service.addOperation(axisOp);
    service.mapActionToOperation(Constants.AXIS2_NAMESPACE_URI + "/echoOMElementNoResponse", axisOp);
    for (Parameter parameter : parameters) {
        service.addParameter(parameter);
    }
    cfgCtx.getAxisConfiguration().addService(service);
}
Also used : InOutAxisOperation(org.apache.axis2.description.InOutAxisOperation) AxisOperation(org.apache.axis2.description.AxisOperation) QName(javax.xml.namespace.QName) AxisService(org.apache.axis2.description.AxisService) RawXMLINOutMessageReceiver(org.apache.axis2.receivers.RawXMLINOutMessageReceiver) Parameter(org.apache.axis2.description.Parameter) RawXMLINOnlyMessageReceiver(org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver) InOutAxisOperation(org.apache.axis2.description.InOutAxisOperation)

Aggregations

QName (javax.xml.namespace.QName)2 InOutAxisOperation (org.apache.axis2.description.InOutAxisOperation)2 AxisFault (org.apache.axis2.AxisFault)1 MessageContext (org.apache.axis2.context.MessageContext)1 AxisOperation (org.apache.axis2.description.AxisOperation)1 AxisService (org.apache.axis2.description.AxisService)1 Parameter (org.apache.axis2.description.Parameter)1 AbstractInOutMessageReceiver (org.apache.axis2.receivers.AbstractInOutMessageReceiver)1 RawXMLINOnlyMessageReceiver (org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver)1 RawXMLINOutMessageReceiver (org.apache.axis2.receivers.RawXMLINOutMessageReceiver)1