Search in sources :

Example 1 with Binding

use of com.sun.xml.ws.wsdl.writer.document.Binding 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);
    }
}
Also used : SOAPBinding(com.sun.xml.ws.api.model.soap.SOAPBinding) ParameterBinding(com.sun.xml.ws.api.model.ParameterBinding) WSBinding(com.sun.xml.ws.api.WSBinding) Binding(com.sun.xml.ws.wsdl.writer.document.Binding) JavaMethodImpl(com.sun.xml.ws.model.JavaMethodImpl) SOAPVersion(com.sun.xml.ws.api.SOAPVersion) SOAPBinding(com.sun.xml.ws.api.model.soap.SOAPBinding)

Aggregations

SOAPVersion (com.sun.xml.ws.api.SOAPVersion)1 WSBinding (com.sun.xml.ws.api.WSBinding)1 ParameterBinding (com.sun.xml.ws.api.model.ParameterBinding)1 SOAPBinding (com.sun.xml.ws.api.model.soap.SOAPBinding)1 JavaMethodImpl (com.sun.xml.ws.model.JavaMethodImpl)1 Binding (com.sun.xml.ws.wsdl.writer.document.Binding)1