Beispiel #1
0
  public void processEditServicePara(HttpServletRequest req, HttpServletResponse res)
      throws IOException, ServletException {
    String serviceName = req.getParameter("axisService");
    if (req.getParameter("changePara") != null) {
      AxisService service = configContext.getAxisConfiguration().getService(serviceName);
      if (service != null) {
        for (Parameter parameter : service.getParameters()) {
          String para = req.getParameter(serviceName + "_" + parameter.getName());
          service.addParameter(new Parameter(parameter.getName(), para));
        }

        for (Iterator<AxisOperation> iterator = service.getOperations(); iterator.hasNext(); ) {
          AxisOperation axisOperation = iterator.next();
          String op_name = axisOperation.getName().getLocalPart();

          for (Parameter parameter : axisOperation.getParameters()) {
            String para = req.getParameter(op_name + "_" + parameter.getName());

            axisOperation.addParameter(new Parameter(parameter.getName(), para));
          }
        }
      }
      res.setContentType("text/html");
      req.setAttribute("status", "Parameters Changed Successfully.");
      req.getSession().removeAttribute(Constants.SERVICE);
    } else {
      AxisService serviceTemp =
          configContext.getAxisConfiguration().getServiceForActivation(serviceName);
      if (serviceTemp.isActive()) {

        if (serviceName != null) {
          req.getSession()
              .setAttribute(
                  Constants.SERVICE, configContext.getAxisConfiguration().getService(serviceName));
        }
      } else {
        req.setAttribute(
            "status",
            "Service "
                + serviceName
                + " is not an active service"
                + ". \n Only parameters of active services can be edited.");
      }
    }
    renderView(SERVICE_PARA_EDIT_JSP_NAME, req, res);
  }