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;
}
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);
}
Aggregations