/** * Initialize HTTP GET request processors * * @param config The ServletConfig of this Servlet */ protected void initGetRequestProcessors(ServletConfig config) { // The ListingAgent is an HTTP GET request processor agent = new ListingAgent(configContext); }
private void handleWSDL2Request(HttpServletRequest req, HttpServletResponse res, String url, AxisService axisService) throws IOException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } res.setContentType("text/xml"); String ip = extractHost(url); String wsdlName = getParamtereIgnoreCase(req , "wsdl2"); int ret = axisService.printWSDL2(res.getOutputStream(), ip, wsdlName); if (ret == 0) { res.sendRedirect(""); } else if (ret == -1) { res.sendError(HttpServletResponse.SC_NOT_FOUND); } }
private void handleXSDRequest(HttpServletRequest req, HttpServletResponse res, AxisService axisService) throws IOException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } res.setContentType("text/xml"); int ret = axisService.printXSD(res.getOutputStream(), getParamtereIgnoreCase(req ,"xsd")); if (ret == 0) { //multiple schemas are present and the user specified //no name - in this case we cannot possibly pump a schema //so redirect to the service root res.sendRedirect(""); } else if (ret == -1) { res.sendError(HttpServletResponse.SC_NOT_FOUND); } }
String serviceName = extractServiceName(url); HashMap<String, AxisService> services = configContext.getAxisConfiguration().getServices(); String query = req.getQueryString(); if (axisService != null) { if (wsdl2 >= 0) { handleWSDL2Request(req, res, url, axisService); return; } else if (wsdl >= 0) { handleWSDLRequest(req, res, url, axisService); return; } else if (xsd >= 0) { handleXSDRequest(req, res, axisService); return; } else if (policy >= 0) { handlePolicyRequest(req, res, serviceName, axisService); return;
agent.processListService(request, response); } else if (HttpUtils.endsWithIgnoreCase(requestURI , ".xsd") || HttpUtils.endsWithIgnoreCase(requestURI, ".wsdl")) { agent.processExplicitSchemaAndWSDL(request, response); } else if (requestURI.endsWith(LIST_SERVICES_SUFFIX) || requestURI.endsWith(LIST_FAULTY_SERVICES_SUFFIX)) { agent.handle(request, response); } catch (Exception e) { throw new ServletException(e);
String serviceName, AxisService axisService) throws IOException, ServletException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; Policy targetPolicy = findPolicy(idParam, axisService);
private Policy findPolicy(String id, AxisDescription des) { Collection<PolicyComponent> policyElements = des.getPolicySubject().getAttachedPolicyComponents(); PolicyRegistry registry = new PolicyRegistryImpl(); Object policyComponent; Policy policy = registry.lookup(id); if (policy != null) { return policy; } for (Iterator<PolicyComponent> iterator = policyElements.iterator(); iterator.hasNext();) { policyComponent = iterator.next(); if (policyComponent instanceof Policy) { // policy found for the id if (id.equals(((Policy) policyComponent).getId())) { return (Policy) policyComponent; } } } AxisDescription child; for (Iterator<? extends AxisDescription> iterator = des.getChildren(); iterator.hasNext();) { child = (AxisDescription) iterator.next(); policy = findPolicy(id, child); if (policy != null) { return policy; } } return null; }
OutputStream out = response.getOutputStream(); response.setContentType("text/xml"); ListingAgent.copy(stream, out); out.flush(); out.close();
String serviceName = extractServiceName(url); HashMap<String, AxisService> services = configContext.getAxisConfiguration().getServices(); String query = req.getQueryString(); if (axisService != null) { if (wsdl2 >= 0) { handleWSDL2Request(req, res, url, axisService); return; } else if (wsdl >= 0) { handleWSDLRequest(req, res, url, axisService); return; } else if (xsd >= 0) { handleXSDRequest(req, res, axisService); return; } else if (policy >= 0) { handlePolicyRequest(req, res, serviceName, axisService); return;
agent.processListService(request, response); } else if (HttpUtils.endsWithIgnoreCase(requestURI , ".xsd") || HttpUtils.endsWithIgnoreCase(requestURI, ".wsdl")) { agent.processExplicitSchemaAndWSDL(request, response); } else if (requestURI.endsWith(LIST_SERVICES_SUFFIX) || requestURI.endsWith(LIST_FAULTY_SERVICES_SUFFIX)) { agent.handle(request, response); } catch (Exception e) { throw new ServletException(e);
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException, ServletException { httpServletRequest = new ForbidSessionCreationWrapper(httpServletRequest); String query = httpServletRequest.getQueryString(); if (query != null) { if (HttpUtils.indexOfIngnoreCase(query , "wsdl2") > 0 || HttpUtils.indexOfIngnoreCase(query, "wsdl") > 0 || HttpUtils.indexOfIngnoreCase(query, "xsd") > 0 || HttpUtils.indexOfIngnoreCase(query, "policy") > 0) { processListService(httpServletRequest, httpServletResponse); } else { super.handle(httpServletRequest, httpServletResponse); } } else { super.handle(httpServletRequest, httpServletResponse); } }
private void handleXSDRequest(HttpServletRequest req, HttpServletResponse res, AxisService axisService) throws IOException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } res.setContentType("text/xml"); int ret = axisService.printXSD(res.getOutputStream(), getParamtereIgnoreCase(req ,"xsd")); if (ret == 0) { //multiple schemas are present and the user specified //no name - in this case we cannot possibly pump a schema //so redirect to the service root res.sendRedirect(""); } else if (ret == -1) { res.sendError(HttpServletResponse.SC_NOT_FOUND); } }
String serviceName, AxisService axisService) throws IOException, ServletException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; Policy targetPolicy = findPolicy(idParam, axisService);
private Policy findPolicy(String id, AxisDescription des) { Collection<PolicyComponent> policyElements = des.getPolicySubject().getAttachedPolicyComponents(); PolicyRegistry registry = new PolicyRegistryImpl(); Object policyComponent; Policy policy = registry.lookup(id); if (policy != null) { return policy; } for (Iterator<PolicyComponent> iterator = policyElements.iterator(); iterator.hasNext();) { policyComponent = iterator.next(); if (policyComponent instanceof Policy) { // policy found for the id if (id.equals(((Policy) policyComponent).getId())) { return (Policy) policyComponent; } } } AxisDescription child; for (Iterator<? extends AxisDescription> iterator = des.getChildren(); iterator.hasNext();) { child = (AxisDescription) iterator.next(); policy = findPolicy(id, child); if (policy != null) { return policy; } } return null; }
OutputStream out = response.getOutputStream(); response.setContentType("text/xml"); ListingAgent.copy(stream, out); out.flush(); out.close();
private void handleWSDL2Request(HttpServletRequest req, HttpServletResponse res, String url, AxisService axisService) throws IOException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } res.setContentType("text/xml"); String ip = extractHost(url); String wsdlName = getParamtereIgnoreCase(req , "wsdl2"); int ret = axisService.printWSDL2(res.getOutputStream(), ip, wsdlName); if (ret == 0) { res.sendRedirect(""); } else if (ret == -1) { res.sendError(HttpServletResponse.SC_NOT_FOUND); } }
/** * Initialize HTTP GET request processors * * @param config The ServletConfig of this Servlet */ protected void initGetRequestProcessors(ServletConfig config) { // The ListingAgent is an HTTP GET request processor agent = new ListingAgent(configContext); }
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException, ServletException { httpServletRequest = new ForbidSessionCreationWrapper(httpServletRequest); String query = httpServletRequest.getQueryString(); if (query != null) { if (HttpUtils.indexOfIngnoreCase(query , "wsdl2") > 0 || HttpUtils.indexOfIngnoreCase(query, "wsdl") > 0 || HttpUtils.indexOfIngnoreCase(query, "xsd") > 0 || HttpUtils.indexOfIngnoreCase(query, "policy") > 0) { processListService(httpServletRequest, httpServletResponse); } else { super.handle(httpServletRequest, httpServletResponse); } } else { super.handle(httpServletRequest, httpServletResponse); } }
private void handleWSDLRequest(HttpServletRequest req, HttpServletResponse res, String url, AxisService axisService) throws IOException { if (!canExposeServiceMetadata(axisService)){ res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } OutputStream out = res.getOutputStream(); res.setContentType("text/xml"); String ip = extractHost(url); String wsdlName = getParamtereIgnoreCase(req , "wsdl"); if (wsdlName != null && wsdlName.length()>0) { axisService.printUserWSDL(out, wsdlName, ip); } else { axisService.printWSDL(out, ip); } }