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(); }
} catch (final AxisFault fault) { if (req.getMethod().equals(HttpRequest.Method.GET.name()) && req.getParameters().isEmpty()) { String serviceName = req.getURI().getRawPath(); serviceName = serviceName.substring(serviceName.lastIndexOf("/") + 1);