Well I defined a subclass of MessageDispatcherServlet to solve my problem. I dont really like to subclass but found it to be the only way. the problem code was
Code:
WebUtils.extractFilenameFromUrlPath(request.getRequestURI()
from
Code:
protected WsdlDefinition getWsdlDefinition(HttpServletRequest request) {
if (HttpTransportConstants.METHOD_GET.equals(request.getMethod()) &&
request.getRequestURI().endsWith(WSDL_SUFFIX_NAME)) {
String fileName = WebUtils.extractFilenameFromUrlPath(request.getRequestURI());
return (WsdlDefinition) wsdlDefinitions.get(fileName);
}
else {
return null;
}
}
which I the changed to:
Code:
/**
* Defines the superclass to allow the definition of wsdls within
* paths instead of just accepting those within the servlet. The reason
* is so we avoid requiring to have 4 different servlets for each of the
* paths e.g. net/dsb/commons, net/dsb/vhs3 etc.
*
* @return WsdlDefinition
*
*/
protected WsdlDefinition getWsdlDefinition(HttpServletRequest request) {
String contextPath = getContextPath();
if (HttpTransportConstants.METHOD_GET.equals(request.getMethod()) &&
request.getRequestURI().endsWith(WSDL_SUFFIX_NAME)) {
String fileName = StringUtils.removeStart(request.getRequestURI(), contextPath);
fileName = StringUtils.removeEnd(fileName, WSDL_SUFFIX_NAME);
return (WsdlDefinition) wsdlDefinitions.get(fileName);
}
else {
return null;
}
}
private String getContextPath() {
return getWebApplicationContext().getServletContext().getContextPath();
}
I also had to refine the initialization of the instance variable so it really does feel like a HACK, but it works. Any other suggestions would be great!
Cheers