webServiceContainer.getWsdl(request, response);
//WHO IS RESPONSIBLE FOR CLOSING OUT?
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw (HttpException) new HttpException(500, "Could not fetch wsdl!").initCause(e);
}
} else {
if (isConfidentialTransportGuarantee) {
if (!req.isConfidential()) {
throw new HttpException(403);
}
} else if (isIntegralTransportGuarantee) {
if (!req.isIntegral()) {
throw new HttpException(403);
}
}
Thread currentThread = Thread.currentThread();
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(classLoader);
//hard to imagine this could be anything but null, but....
Subject oldSubject = ContextManager.getCurrentCaller();
try {
if (authenticator != null) {
String pathInContext = org.mortbay.util.URI.canonicalPath(req.getPath());
if (authenticator.authenticate(realm, pathInContext, req, res) == null) {
throw new HttpException(403);
}
} else {
//EJB will figure out correct defaultSubject shortly
//TODO consider replacing the GenericEJBContainer.DefaultSubjectInterceptor with this line
//setting the defaultSubject.
ContextManager.setCurrentCaller(null);
}
try {
webServiceContainer.invoke(request, response);
req.setHandled(true);
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw (HttpException) new HttpException(500, "Could not process message!").initCause(e);
}
} finally {
ContextManager.setCurrentCaller(oldSubject);
currentThread.setContextClassLoader(oldClassLoader);
}