*/
private void getWsdl(HttpServletRequest request,
HttpServletResponse response) throws IOException {
WSDLFactory factory = new WSDLFactoryImpl();
WSDLReader reader = factory.newWSDLReader();
WSDLWriter writer = factory.newWSDLWriter();
String wsdllocation = ctx.getRealPath("/wfxml.wsdl");
File file = new File(wsdllocation);
try {
Definition definition = reader.readWSDL(file.toURI().getPath());
String requestBasePath = getRequestBasePath(request);
if (requestBasePath.endsWith("/")) {
requestBasePath
= requestBasePath.substring(0, requestBasePath.length() -1);
}
definition.setDocumentBaseURI(requestBasePath);
adjustReferencedElements(definition, requestBasePath);
addWsdlService(request, definition, "WfXmlServiceRegistry",
"WfMOpenServiceRegistry", "WfMOpenServiceRegistryService");
addWsdlService(request, definition, "WfXmlFactory",
"WfMOpenFactory", "WfMOpenFactoryService");
addWsdlService(request, definition, "WfXmlInstance",
"WfMOpenInstance", "WfMOpenInstanceService");
addWsdlService(request, definition, "WfXmlActivity",
"WfMOpenActivity", "WfMOpenActivityService");
writer.writeWSDL(definition, response.getOutputStream());
} catch (WSDLException e) {
throw new IOException(e.getMessage());
}
}