Definition definition = wsBinding.getGeneratedWSDLDocument();
QName serviceQName = wsBinding.getService().getQName();
Definition def = getDefinition(definition, serviceQName);
ClassLoader oldTCCL = axis2Config.classLoaderContext.setContextClassLoader();
final WSDLToAxisServiceBuilder builder;
try {
builder = new WSDL11ToAxisServiceBuilder(def, serviceQName, port.getName());
} finally {
if (oldTCCL != null) {
Thread.currentThread().setContextClassLoader(oldTCCL);
}
}
//final WSDLToAxisServiceBuilder builder = new WSDL11ToAxisServiceBuilder(def, serviceQName, port.getName());
builder.setServerSide(true);
// [rfeng] Add a custom resolver to work around WSCOMMONS-228
// TODO - 228 is resolved, is this still required
builder.setCustomResolver(new URIResolverImpl(def));
builder.setBaseUri(def.getDocumentBaseURI());
// [rfeng]
// AxisService axisService = builder.populateService();
// Allow privileged access to read properties. Requires PropertiesPermission read in
// security policy.
AxisService axisService;
try {
axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
public AxisService run() throws AxisFault {
return builder.populateService();
}
});
} catch (PrivilegedActionException e) {
throw (AxisFault)e.getException();
}