* Null if this is for dispatch. Otherwise the interface the proxy is going to implement
* @return
* The initialized BindingImpl
*/
public BindingImpl createBinding(WebServiceFeature[] webServiceFeatures, Class<?> portInterface) {
WebServiceFeatureList r = new WebServiceFeatureList(webServiceFeatures);
Iterable<WebServiceFeature> configFeatures;
//TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving
// ability to turn off the WSDL/Policy based features and its associated tubes.
//Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration
if (portModel != null) {
// could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap
// for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(),
// So, using here WsdlModel for merging is right.
// merge features from WSDL
configFeatures = portModel.getFeatures();
} else {
configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName);
}
r.mergeFeatures(configFeatures, false);
// merge features from interceptor
r.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this,portInterface,r), false);
BindingImpl bindingImpl = BindingImpl.create(bindingId, r.toArray());
owner.getHandlerConfigurator().configureHandlers(this,bindingImpl);
return bindingImpl;
}