class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSupport implements HandlerAdapter, InitializingBean {

	@Override
	public ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		if (HttpTransportConstants.METHOD_GET.equals(request.getMethod())) {
			WsdlDefinition definition = (WsdlDefinition) handler;

			Transformer transformer = createTransformer();
			Source definitionSource = definition.getSource();

			if (transformLocations || transformSchemaLocations) {
				DOMResult domResult = new DOMResult();
				transformer.transform(definitionSource, domResult);
				Document definitionDocument = (Document) domResult.getNode();
				if (transformLocations) {
					transformLocations(definitionDocument, request);
				}
				if (transformSchemaLocations) {
					transformSchemaLocations(definitionDocument, request);
				}
				definitionSource = new DOMSource(definitionDocument);
			}

			response.setContentType(CONTENT_TYPE);
			StreamResult responseResult = new StreamResult(response.getOutputStream());
			transformer.transform(definitionSource, responseResult);
		} else {
			response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
		}
		return null;
	}

}