/**
* Generates the Binding section of the WSDL
*/
protected void generateBinding() {
Binding binding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart());
extension.addBindingExtension(binding);
binding.type(model.getPortTypeName());
boolean first = true;
for (JavaMethodImpl method : model.getJavaMethods()) {
if (first) {
SOAPBinding sBinding = method.getBinding();
SOAPVersion soapVersion = sBinding.getSOAPVersion();
if (soapVersion == SOAPVersion.SOAP_12){
com.sun.xml.internal.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = binding.soap12Binding();
soapBinding.transport(this.binding.getBindingId().getTransport());
if (sBinding.getStyle().equals(Style.DOCUMENT))
soapBinding.style(DOCUMENT);
else
soapBinding.style(RPC);
} else {
com.sun.xml.internal.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = binding.soapBinding();
soapBinding.transport(this.binding.getBindingId().getTransport());
if (sBinding.getStyle().equals(Style.DOCUMENT))
soapBinding.style(DOCUMENT);
else
soapBinding.style(RPC);