Search in sources :

Example 1 with XTSServiceTestInterpreter

use of org.jboss.jbossts.xts.servicetests.service.XTSServiceTestInterpreter in project narayana by jbosstm.

the class XTSSubordinateServiceTestPortTypeImpl method serve.

/**
 * @param commands
 * @return
 *     returns org.jboss.jbossts.xts.servicetests.generated.ResultsType
 */
@WebMethod
@WebResult(name = "results", targetNamespace = "http://jbossts.jboss.org/xts/servicetests/generated", partName = "results")
public ResultsType serve(@WebParam(name = "commands", targetNamespace = "http://jbossts.jboss.org/xts/servicetests/generated", partName = "commands") CommandsType commands) {
    ResultsType results = new ResultsType();
    List<String> resultsList = results.getResultList();
    List<String> commandList = commands.getCommandList();
    MessageContext messageContext = context.getMessageContext();
    HttpServletRequest servletRequest = ((HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST));
    String path = servletRequest.getServletPath();
    System.out.println("service " + path);
    for (String s : commandList) {
        System.out.println("  command " + s);
    }
    XTSServiceTestInterpreter service = XTSServiceTestInterpreter.getService(path);
    service.processCommands(commandList, resultsList);
    return results;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ResultsType(org.jboss.jbossts.xts.servicetests.generated.ResultsType) XTSServiceTestInterpreter(org.jboss.jbossts.xts.servicetests.service.XTSServiceTestInterpreter) MessageContext(javax.xml.ws.handler.MessageContext)

Aggregations

HttpServletRequest (javax.servlet.http.HttpServletRequest)1 MessageContext (javax.xml.ws.handler.MessageContext)1 ResultsType (org.jboss.jbossts.xts.servicetests.generated.ResultsType)1 XTSServiceTestInterpreter (org.jboss.jbossts.xts.servicetests.service.XTSServiceTestInterpreter)1