use of org.apache.axis2.transport.testkit.message.RESTMessage.Parameter 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