Search in sources :

Example 16 with SOAPVersion

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);
    }
}
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)16 AddressingVersion (com.sun.xml.ws.api.addressing.AddressingVersion)4 SOAPMessage (jakarta.xml.soap.SOAPMessage)4 WebServiceException (jakarta.xml.ws.WebServiceException)4 Message (com.sun.xml.ws.api.message.Message)3 Packet (com.sun.xml.ws.api.message.Packet)3 SAAJMessage (com.sun.xml.ws.message.saaj.SAAJMessage)3 SOAPException (jakarta.xml.soap.SOAPException)3 MessageContext (com.oracle.webservices.api.message.MessageContext)2 Attachment (com.sun.xml.ws.api.message.Attachment)2 StreamingDataHandler (com.sun.xml.ws.developer.StreamingDataHandler)2 MIMEPartStreamingDataHandler (com.sun.xml.ws.encoding.MIMEPartStreamingDataHandler)2 XMLStreamException (javax.xml.stream.XMLStreamException)2 WSBinding (com.sun.xml.ws.api.WSBinding)1 WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)1 ExceptionHasMessage (com.sun.xml.ws.api.message.ExceptionHasMessage)1 Header (com.sun.xml.ws.api.message.Header)1 HeaderList (com.sun.xml.ws.api.message.HeaderList)1 ParameterBinding (com.sun.xml.ws.api.model.ParameterBinding)1 SOAPBinding (com.sun.xml.ws.api.model.soap.SOAPBinding)1