binding = (org.apache.axis2.jaxws.spi.Binding) BindingUtils.createBinding(endpointDesc);
if(log.isDebugEnabled()){
log.debug("Lookign for Handler Resolver");
}
// TODO should we allow the ServiceDelegate to figure out the default handlerresolver? Probably yes, since a client app may look for one there.
HandlerResolver handlerResolver = null;
if(serviceDelegate.getHandlerResolver() != null){
if(log.isDebugEnabled()){
log.debug("Reading default Handler Resolver ");
}
handlerResolver = serviceDelegate.getHandlerResolver();
}
else{
handlerResolver = new HandlerResolverImpl(endpointDesc.getServiceDescription(), serviceDelegate);
if(log.isDebugEnabled()){
log.debug("Creating new Handler Resolver using HandlerResolverImpl");
}
}
// See if the metadata from creating the service indicates that MTOM, Addressing and/or RespectBinding should be enabled
if (binding instanceof SOAPBinding) {
configureBindingFromMetadata();
}
// check for properties that need to be set on the BindingProvider
String seiName = null;
if(endpointDesc.getEndpointInterfaceDescription() != null
&&
endpointDesc.getEndpointInterfaceDescription().getSEIClass() != null) {
seiName = endpointDesc.getEndpointInterfaceDescription().getSEIClass().getName();
}
String portQNameString = endpointDesc.getPortQName().toString();
String key = seiName + ":" + portQNameString;
Map<String, Object> bProps = endpointDesc.getServiceDescription().getBindingProperties(serviceDelegate, key);
if(bProps != null) {
if(log.isDebugEnabled()) {
log.debug("Setting binding props with size: " + bProps.size() + " on " +
"BindingProvider RequestContext");
}
requestContext.putAll(bProps);
}
binding.setHandlerChain(handlerResolver.getHandlerChain(endpointDesc.getPortInfo()));
//Set JAX-WS 2.1 related properties.
try {
binding.setAxis2EndpointReference(epr);
binding.setAddressingNamespace(addressingNamespace);