use of com.sun.xml.ws.api.SOAPVersion in project metro-jax-ws by eclipse-ee4j.
the class WSDLGenerator method generateBinding.
/**
* Generates the Binding section of the WSDL
*/
protected void generateBinding() {
Binding newBinding = serviceDefinitions.binding().name(model.getBoundPortTypeName().getLocalPart());
extension.addBindingExtension(newBinding);
newBinding.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.ws.wsdl.writer.document.soap12.SOAPBinding soapBinding = newBinding.soap12Binding();
soapBinding.transport(this.binding.getBindingId().getTransport());
if (sBinding.getStyle().equals(Style.DOCUMENT))
soapBinding.style(DOCUMENT);
else
soapBinding.style(RPC);
} else {
com.sun.xml.ws.wsdl.writer.document.soap.SOAPBinding soapBinding = newBinding.soapBinding();
soapBinding.transport(this.binding.getBindingId().getTransport());
if (sBinding.getStyle().equals(Style.DOCUMENT))
soapBinding.style(DOCUMENT);
else
soapBinding.style(RPC);
}
first = false;
}
if (this.binding.getBindingId().getSOAPVersion() == SOAPVersion.SOAP_12)
generateSOAP12BindingOperation(method, newBinding);
else
generateBindingOperation(method, newBinding);
}
}
Aggregations