public void onMessage(HttpRequest request, HttpResponse response) throws Exception { Map<String, HttpListener> listeners; synchronized (registry) { listeners = new HashMap<String, HttpListener>(registry); } String path = request.getURI().getPath(); for (Map.Entry<String, HttpListener> entry : listeners.entrySet()) { String pattern = entry.getKey(); HttpListener listener = entry.getValue(); if (path.matches(pattern)) { listener.onMessage(request, response); break; } } }
public void getWsdl(final HttpRequest request, final HttpResponse response) throws Exception { final URI realLocation = request.getURI(); // log.info("Request at " + realLocation); final String query = realLocation.getQuery(); if (query == null || !query.toLowerCase().startsWith("wsdl")) { throw new IllegalStateException("request must contain a wsdl or WSDL parameter: " + request.getParameters()); } final String locationKey; if (query.length() > 4) { locationKey = query.substring(5); } else { locationKey = wsdlLocation.toString(); } final Object wsdl = wsdlMap.get(locationKey); if (wsdl == null) { throw new IllegalStateException("No wsdl or schema known at location: " + locationKey); } final URI updated = new URI(realLocation.getScheme(), realLocation.getUserInfo(), realLocation.getHost(), realLocation.getPort(), null, //try null for no path null, null); final String replaced = ((String) wsdl).replaceAll(WsConstants.LOCATION_REPLACEMENT_TOKEN, updated.toString()); response.getOutputStream().write(replaced.getBytes()); response.getOutputStream().flush(); }
@Override public void onMessage(final HttpRequest request, final HttpResponse response) throws Exception { final String path = request.getURI().getPath(); final FilterListener currentFL = currentFilterListener.get();
messageContext.setProperty(HTTPConstants.MC_HTTP_SERVLETPATHINFO, req.getURI().getPath()); messageContext.setProperty(org.apache.axis.MessageContext.TRANS_URL, req.getURI().toString()); messageContext.setService(service); messageContext.setProperty(REQUEST, req); String serviceName = req.getURI().getRawPath(); serviceName = serviceName.substring(serviceName.lastIndexOf("/") + 1); printServiceInfo(res, serviceName);