private WSDLBinding processBinding(Definition srcWsdl, Binding srcBinding) throws WSDLException
{
QName srcBindingQName = srcBinding.getQName();
log.trace("processBinding: " + srcBindingQName);
WSDLBinding destBinding = destWsdl.getBinding(srcBindingQName);
if (destBinding == null)
{
PortType srcPortType = getDefinedPortType(srcBinding);
String bindingType = null;
List<ExtensibilityElement> extList = srcBinding.getExtensibilityElements();
for (ExtensibilityElement extElement : extList)
{
QName elementType = extElement.getElementType();
if (extElement instanceof SOAPBinding)
{
bindingType = Constants.NS_SOAP11;
}
else if (extElement instanceof SOAP12Binding)
{
bindingType = Constants.NS_SOAP12;
}
else if (extElement instanceof HTTPBinding)
{
bindingType = Constants.NS_HTTP;
}
else if ("binding".equals(elementType.getLocalPart()))
{
log.warn("Unsupported binding: " + elementType);
bindingType = elementType.getNamespaceURI();
}
}
if (bindingType == null)
throw new WSDLException(WSDLException.INVALID_WSDL, "Cannot obtain binding type for: " + srcBindingQName);
if (Constants.NS_SOAP11.equals(bindingType) || Constants.NS_SOAP12.equals(bindingType) || Constants.NS_HTTP.equals(bindingType))
{
destBinding = new WSDLBinding(destWsdl, srcBindingQName);
destBinding.setInterfaceName(srcPortType.getQName());
destBinding.setType(bindingType);
processUnknownExtensibilityElements(srcBinding, destBinding);
destWsdl.addBinding(destBinding);
preProcessSWAParts(srcBinding, srcWsdl);
processPortType(srcWsdl, srcPortType, destBinding);