Search in sources :

Example 1 with RawXMLINOnlyMessageReceiver

use of org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver 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)1 AxisOperation (org.apache.axis2.description.AxisOperation)1 AxisService (org.apache.axis2.description.AxisService)1 InOutAxisOperation (org.apache.axis2.description.InOutAxisOperation)1 Parameter (org.apache.axis2.description.Parameter)1 RawXMLINOnlyMessageReceiver (org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver)1 RawXMLINOutMessageReceiver (org.apache.axis2.receivers.RawXMLINOutMessageReceiver)1